Repository navigation
Give long tests of a flaky check a per-test timeout that matches them - #121387
Conversation
A flaky check hands every worker the *same* changed test, so one heavy test contends with `--jobs N` copies of itself instead of with N unrelated tests. `clickhouse-test` already accounts for that: a test tagged `long` is exempt from the `TEST_MAX_RUN_TIME_IN_SECONDS` "too long" verdict of the check. The per-test budget was not exempt, though - `proc.wait(args.timeout)` killed such a test at the `--timeout` default of 600s regardless of the tag - so a pull request that merely edits one draws a red that says nothing about the change. Measured on `03927_autopr_input_bytes_estimation_prewhere_filter`, whose p50 under any `asan` lane on master is 33s and whose p90 is 55s: in the `amd_asan_ubsan` flaky check it runs in 307-383s and is killed at 600.3s. The inflation is the check's shape rather than a property of the test - in the same job the other five AutoPR estimation tests are 4.1x to 5.6x their own master p50 - and it has already produced the same 600.3s kill on pull requests that have nothing in common: #96844, #119350 and #100736. `TestCase.get_timeout` now gives a `long` test of a flaky check `FLAKY_CHECK_LONG_TEST_TIMEOUT_MULTIPLIER` times `--timeout`, and is the single place the per-test budget is read: the wait, the cleanup budget, the worker's upper-level alarm, and `CLICKHOUSE_TEST_TIMEOUT` for a `.sh` test that budgets itself against the harness. Every other test and every other job keeps `--timeout` unchanged. The external safety net in `run_tests` has to stay above the graceful alarm it exists to avoid pre-empting, so it is now derived from the same numbers instead of being a written-out 900s. For a job that is not a flaky check the derivation yields exactly the 900s it has always been; for a flaky check it yields 2220s, still far below the 2.5h job timeout. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [d2b3a90] Summary: ✅ AI ReviewSummaryThis PR fixes the original false-positive 600s timeout for Findings
Final Verdict
LLVM Coverage ReportMeasured on commit d2b3a90.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +201 lines in 52 files (-120 lines lost coverage) · Details |
…elves Address review: `--flaky-check` also covers the targeted check, which passes `--no-self-parallel`, and the sequential runner, and neither of them ever runs concurrent copies of the same test. Give the multiplied budget only to a `long` test run by the parallel workers without `--no-self-parallel`, and size the external safety net in `run_tests` by the same condition, so the targeted check keeps the 900s margin it has always had. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
| if ( | ||
| args.flaky_check | ||
| and not args.no_self_parallel | ||
| and self.is_concurrent |
There was a problem hiding this comment.
self.is_concurrent is only "this test came from the parallel queue", not "this test still has peer copies that can contend with it". In do_run_tests the flaky-check pool can shed workers under memory pressure until only one process remains (tests/clickhouse-test:6191), and a local flaky run can start at --jobs 1 too. In both cases later long tests still match this predicate and get 3 * --timeout even though they now run alone.
That breaks the contract from the docstring: once the pool has serialized itself there is no self-contention to compensate for, but one wedged long test can still consume another 30 minutes and weaken the 20/45-minute flaky-check signal. The multiplier needs to follow the current ability to run peer copies concurrently, not just whether the test originally came from the parallel worker path.
ClickHouse#121387 made `run_single_test` call `get_timeout`, which reads `flaky_check` and `no_self_parallel` from the test case arguments and `is_concurrent` from the test case. The stand-in built by `make_case` had none of them, so `run_single_test` raised `AttributeError` before it reached the replaced `Popen`, and the test failed in the merge queue with a `TypeError` on `seen`. With the attributes set to their defaults the test passes against the merged runner again, and against master's runner (without the spawn change) all seven reference lines still differ. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=gh-readonly-queue/master/pr-112265-00721e1919652f65821d92356b3d8eea5848f8d2&sha=3b6d2a99a5abb1aa1963c91a8df6d403053f2eeb&name_0=MergeQueueCI&name_1=Fast%20test Co-Authored-By: Claude Opus 5.5 <[email protected]>
A flaky check hands every worker the same changed test, so one heavy test contends with
--jobs Ncopies of itself instead of with N unrelated tests.clickhouse-testalready accounts for that: a test taggedlongis exempt from theTEST_MAX_RUN_TIME_IN_SECONDS"too long" verdict of the check. The per-test budget was not exempt, though -proc.wait(args.timeout)killed such a test at the--timeoutdefault of 600s regardless of the tag - so a pull request that merely edits one draws a red that says nothing about the change.Measured on
03927_autopr_input_bytes_estimation_prewhere_filter, whose p50 under anyasanlane on master is 33s and whose p90 is 55s: in theamd_asan_ubsanflaky check it runs in 307-383s and is killed at 600.3s. The inflation is the check's shape rather than a property of the test - in the same job the other five AutoPR estimation tests are 4.1x to 5.6x their own master p50 (0363466.6s against 16.3s,0434027s against 5.7s,03634_compact26s against 4.6s,0483815s against 3s) - and it has already produced the same 600.3s kill on pull requests that have nothing in common: #96844, #119350 and #100736.TestCase.get_timeoutnow gives alongtest of a flaky checkFLAKY_CHECK_LONG_TEST_TIMEOUT_MULTIPLIERtimes--timeout- but only when it runs in the parallel worker pool without--no-self-parallel, i.e. where copies of it can actually contend with each other; the targeted check and the sequential runner keep--timeout- and is the single place the per-test budget is read: the wait, the cleanup budget, the worker's upper-level alarm, andCLICKHOUSE_TEST_TIMEOUTfor a.shtest that budgets itself against the harness. Every other test and every other job keeps--timeoutunchanged, so the 600s net still catches a new test that is merely slow, and the 180sTEST_MAX_RUN_TIME_IN_SECONDSverdict still fails one that is not taggedlong.The external safety net in
run_testshas to stay above the graceful alarm it exists to avoid pre-empting, so it is now derived from the same numbers instead of being a written-out 900s. For a job that is not a flaky check the derivation yields exactly the 900s it has always been; for a flaky check without--no-self-parallelit yields 2220s, still far below the 2.5h job timeout.Related: #96844
Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/121387]
Version info
26.10.1.772-master(included in26.10and later)