From fe3faf98d8b398e3a13dd3956f1a502f02892d21 Mon Sep 17 00:00:00 2001 From: Ioan Moldovan Date: Mon, 16 Mar 2026 16:24:00 -0700 Subject: [PATCH 1/2] fix: remove duplicate timeout setting --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index de17c1c83d3..0667c71f9d8 100644 --- a/package.json +++ b/package.json @@ -75,22 +75,22 @@ "test_local_chrome_enterprise_mock": "npm run pretest && npm run test_ci_chrome_enterprise -- -- --pool-size=1 --debug", "test_local_chrome_consumer_live_gmail": "npm run pretest && npm run test_ci_chrome_consumer_live_gmail -- -- --pool-size=1 --debug", "test_local_chrome_consumer_mock_flaky": "npm run pretest && npm run test_ci_chrome_consumer_flaky -- -- --pool-size=1 --retry=false --debug", - "test_local_unit_consumer": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug CONSUMER-MOCK | npx tap-xunit > report.xml", - "test_local_unit_enterprise": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK | npx tap-xunit > report.xml", + "test_local_unit_consumer": "npm run pretest && npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug CONSUMER-MOCK | npx tap-xunit > report.xml", + "test_local_unit_enterprise": "npm run pretest && npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK | npx tap-xunit > report.xml", "test_local_chrome_consumer_mock_headless": "xvfb-run npm run test_local_chrome_consumer_mock", "test_stylelint": "stylelint extension/css/cryptup.css extension/css/settings.css extension/css/webmail.css && stylelint extension/**/*.htm --custom-syntax postcss-html", "test_eslint": "cross-env NODE_OPTIONS=--max-old-space-size=4096 eslint .", "test_eslint_ci": "npm run test_eslint -- --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif", "test_patterns": "node build/test/test/source/patterns.js", "test_async_stack": "node build/test/test/source/async-stack.js", - "test_buf": "npx ava --timeout=3m --verbose --concurrency=10 build/test/test/source/buf.js", - "test_ci_chrome_consumer_live_gmail": "npx ava --timeout=45m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer": "npx ava --timeout=30m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP", - "test_ci_chrome_enterprise": "npx ava --timeout=30m --verbose --tap --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky_1": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-1 | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky_2": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-2 | npx tap-xunit > report.xml", - "test_ci_chrome_content_scripts": "npx ava --timeout=3m --verbose --tap build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS > report.xml", + "test_buf": "npx ava --verbose --concurrency=10 build/test/test/source/buf.js", + "test_ci_chrome_consumer_live_gmail": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer": "npx ava --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP", + "test_ci_chrome_enterprise": "npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky_1": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-1 | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky_2": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-2 | npx tap-xunit > report.xml", + "test_ci_chrome_content_scripts": "npx ava --verbose --tap build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS > report.xml", "dev_start_gmail_mock_api": "./scripts/build.sh && cd ./conf && node ../build/tooling/tsc-compiler --project tsconfig.test.json && cd .. && node ./build/test/test/source/mock.js", "run_firefox": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile ~/.mozilla/firefox/flowcrypt-dev --keep-profile-changes", "run_firefox_windows": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile %userprofile%/AppData/Local/Mozilla/Firefox/Profiles/flowcrypt-dev --keep-profile-changes", From 76d58d66683d44967caab585734e01e83b178b30 Mon Sep 17 00:00:00 2001 From: Ioan Moldovan Date: Mon, 16 Mar 2026 16:56:54 -0700 Subject: [PATCH 2/2] fix: test --- package.json | 20 ++++++++++---------- test/source/test.ts | 5 +---- test/source/tests/tooling/index.ts | 1 - 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 76a26901dcb..d8205b253b6 100644 --- a/package.json +++ b/package.json @@ -75,22 +75,22 @@ "test_local_chrome_enterprise_mock": "npm run pretest && npm run test_ci_chrome_enterprise -- -- --pool-size=1 --debug", "test_local_chrome_consumer_live_gmail": "npm run pretest && npm run test_ci_chrome_consumer_live_gmail -- -- --pool-size=1 --debug", "test_local_chrome_consumer_mock_flaky": "npm run pretest && npm run test_ci_chrome_consumer_flaky -- -- --pool-size=1 --retry=false --debug", - "test_local_unit_consumer": "npm run pretest && npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug CONSUMER-MOCK | npx tap-xunit > report.xml", - "test_local_unit_enterprise": "npm run pretest && npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK | npx tap-xunit > report.xml", + "test_local_unit_consumer": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug CONSUMER-MOCK | npx tap-xunit > report.xml", + "test_local_unit_enterprise": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK | npx tap-xunit > report.xml", "test_local_chrome_consumer_mock_headless": "xvfb-run npm run test_local_chrome_consumer_mock", "test_stylelint": "stylelint extension/css/cryptup.css extension/css/settings.css extension/css/webmail.css && stylelint extension/**/*.htm --custom-syntax postcss-html", "test_eslint": "cross-env NODE_OPTIONS=--max-old-space-size=4096 eslint .", "test_eslint_ci": "npm run test_eslint -- --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif", "test_patterns": "node build/test/test/source/patterns.js", "test_async_stack": "node build/test/test/source/async-stack.js", - "test_buf": "npx ava --verbose --concurrency=10 build/test/test/source/buf.js", - "test_ci_chrome_consumer_live_gmail": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer": "npx ava --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP", - "test_ci_chrome_enterprise": "npx ava --verbose --tap --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky_1": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-1 | npx tap-xunit > report.xml", - "test_ci_chrome_consumer_flaky_2": "npx ava --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-2 | npx tap-xunit > report.xml", - "test_ci_chrome_content_scripts": "npx ava --verbose --tap build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS > report.xml", + "test_buf": "npx ava --timeout=3m --verbose --concurrency=10 build/test/test/source/buf.js", + "test_ci_chrome_consumer_live_gmail": "npx ava --timeout=45m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer": "npx ava --timeout=30m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP", + "test_ci_chrome_enterprise": "npx ava --timeout=30m --verbose --tap --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky_1": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-1 | npx tap-xunit > report.xml", + "test_ci_chrome_consumer_flaky_2": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP-2 | npx tap-xunit > report.xml", + "test_ci_chrome_content_scripts": "npx ava --timeout=3m --verbose --tap build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS > report.xml", "dev_start_gmail_mock_api": "./scripts/build.sh && cd ./conf && node ../build/tooling/tsc-compiler --project tsconfig.test.json && cd .. && node ./build/test/test/source/mock.js", "run_firefox": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile ~/.mozilla/firefox/flowcrypt-dev --keep-profile-changes", "run_firefox_windows": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile %userprofile%/AppData/Local/Mozilla/Firefox/Profiles/flowcrypt-dev --keep-profile-changes", diff --git a/test/source/test.ts b/test/source/test.ts index 288e714adc9..455d3b8167b 100644 --- a/test/source/test.ts +++ b/test/source/test.ts @@ -36,17 +36,14 @@ const consts = { // higher concurrency can cause 429 google errs when composing TIMEOUT_SHORT: minutes(1), TIMEOUT_EACH_RETRY: minutes(4), - TIMEOUT_ALL_RETRIES: minutes(55), // this has to suffer waiting for semaphore between retries, thus almost the same as below - TIMEOUT_OVERALL: minutes(60), + TIMEOUT_ALL_RETRIES: minutes(55), ATTEMPTS: testGroup === 'STANDARD-GROUP' ? oneIfNotPooled(3) : process.argv.includes('--retry=false') ? 1 : 3, POOL_SIZE: oneIfNotPooled(isMock ? 20 : 3), - PROMISE_TIMEOUT_OVERALL: undefined as unknown as Promise, // will be set right below IS_LOCAL_DEBUG: process.argv.includes('--debug') ? true : false, // run locally by developer, not in ci }; /* eslint-enable @typescript-eslint/naming-convention */ console.info('consts: ', JSON.stringify(consts), '\n'); -consts.PROMISE_TIMEOUT_OVERALL = new Promise((resolve, reject) => setTimeout(() => reject(new Error(`TIMEOUT_OVERALL`)), consts.TIMEOUT_OVERALL)); export type Consts = typeof consts; export type CommonAcct = 'compatibility' | 'compose' | 'ci.tests.gmail'; diff --git a/test/source/tests/tooling/index.ts b/test/source/tests/tooling/index.ts index bc45e24430f..a78c8649754 100644 --- a/test/source/tests/tooling/index.ts +++ b/test/source/tests/tooling/index.ts @@ -81,7 +81,6 @@ export const newWithTimeoutsFunc = (consts: Consts): ((actionPromise: Promise Promise.race([ actionPromise, // the actual action being performed timeoutAllRetries, // timeout for all test retries - consts.PROMISE_TIMEOUT_OVERALL, // overall timeout for the whole test process / sequence ]); };