From 8d8a2ab64ef63bf7a722213f39d947c262d63042 Mon Sep 17 00:00:00 2001 From: shishu314 Date: Wed, 8 Oct 2025 17:21:02 -0400 Subject: [PATCH] Fix(doc) - Add section in docs for deflaking (#10750) Co-authored-by: gemini-cli-robot --- docs/integration-tests.md | 8 ++++++++ scripts/deflake.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/integration-tests.md b/docs/integration-tests.md index 85e02aacef..c3da474abd 100644 --- a/docs/integration-tests.md +++ b/docs/integration-tests.md @@ -34,6 +34,14 @@ To run a single test by its name, use the `--test-name-pattern` flag: npm run test:e2e -- --test-name-pattern "reads a file" ``` +### Deflaking a test + +Before adding a **new** integration test, you should test it at least 5 times with the deflake script to make sure that it is not flaky. + +```bash +npm run deflake -- --runs=5 --command="npm run test:e2e -- --test-name-pattern ''" +``` + ### Running all tests To run the entire suite of integration tests, use the following command: diff --git a/scripts/deflake.js b/scripts/deflake.js index a093408365..08eace5b43 100644 --- a/scripts/deflake.js +++ b/scripts/deflake.js @@ -57,7 +57,7 @@ async function main() { }) .option('runs', { type: 'number', - default: 50, + default: 5, description: 'The number of runs to perform', }).argv;