Repository navigation
Fix flaky test 04312_client_chime_on_slow_query_92718 - #109001
alexey-milovidov merged 1 commit into
Conversation
Cases 4 and 11 ran 'SELECT sleep(1.5), throwIf(1 = 1, ...)' as two sibling projection columns. Their evaluation order is unspecified, so throwIf could fire before sleep ran: the query then errored at ~0s elapsed, below the --chime 1 threshold, and no BEL was emitted. Case 11 (pty) intermittently printed 'no BEL' instead of the expected 'BEL'; the error message was still present, which is the signature seen in CI (amd_tsan, arm_asan_ubsan), where thread-fuzzer slowdown widens the race window. Nest sleep inside throwIf's argument: 'SELECT throwIf(sleep(1.5) = 0, ...)'. sleep(1.5) returns 0, so the predicate is true and throwIf still throws 'expected error', but only after the 1.5s sleep has run. Elapsed time is therefore always >= 1.5s and the chime fires deterministically. The threshold gate is unchanged (verified: --chime 10 still emits no BEL), so the test still catches a threshold regression. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
cc @azat — flaky-test fix: cases 4/11 ran |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-7:20260630-225600 |
|
Workflow [PR], commit [2f86126] Summary: ✅ AI ReviewSummary
Final Verdict
|
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 112 line(s), 28 function(s) across 30 file(s) · Details Top files
|
CI finish ledger — 2f86126CI fully finished (Finish Workflow = success). All checks green; no failures.
Our test Session id: cron:our-pr-ci-monitor:20260701-033000 |
…-04312-chime-throwif-eval-order Fix flaky test 04312_client_chime_on_slow_query_92718
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Fixes flaky
04312_client_chime_on_slow_query_92718(seen onStateless tests (amd_tsan, parallel, 1/2)and(arm_asan_ubsan, azure, parallel)).Cases 4 and 11 ran
SELECT sleep(1.5), throwIf(1 = 1, 'expected error')as two sibling projection columns. Their evaluation order is unspecified, sothrowIfcould fire beforesleepran: the query then errored at ~0s elapsed, below the--chime 1threshold, and noBELwas emitted. Case 11 (pty) intermittently printedno BELinstead of the expectedBELwhile the'expected error'message was still present, which is exactly the diff signature seen in CI. Thread-fuzzer / sanitizer slowdown widens the race window, so it surfaced mostly under tsan/asan.The fix nests
sleepinsidethrowIf's argument:SELECT throwIf(sleep(1.5) = 0, 'expected error').sleep(1.5)returns0, so the predicate is true andthrowIfstill throws'expected error', but only after the 1.5s sleep has run. Elapsed time is therefore always >= 1.5s and the chime fires deterministically.Verified locally with a
--chime-capable build (clickhouse-local exercises the sameClientBasechime path): the new form emitsBEL25/25 under a pty, wall time is always ~1.85s, and--chime 10still emits noBEL(the threshold gate, hence the test's ability to catch a threshold regression, is unchanged).Version info
26.7.1.321(included in26.7and later)