Repository navigation
Fix flaky test 00612_pk_in_tuple_perf - #109039
alexey-milovidov merged 1 commit into
Conversation
The "non-const args in tuple" section used today() in both the INSERT (today() - number) and the SELECT ((u, d) IN ((0, today()), (1, today()))). today() is evaluated independently at INSERT and SELECT time; if the wall clock crosses midnight (in the randomized session timezone) between the two client invocations, today()@select differs from today()@insert, so row 0 no longer matches and count() returns 0 instead of 1 (rows_read stays 2, since the primary key still selects the same granules). The 15-25x slowdown of the amd_msan/WasmEdge build widens the INSERT->SELECT window and makes the midnight straddle occasionally happen. Replace today() with a fixed toDate('2020-01-01'). It is still a non-const function expression (preserving the test's intent to cover non-const tuple elements), but it is timezone-independent and stable across the two queries. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260701-094200 |
|
cc @CurtizJ — could you review this? It fixes a rare flake in 00612_pk_in_tuple_perf: the test used today() in both the INSERT and the SELECT, so a midnight straddle between the two client calls (widened by the slow msan/WasmEdge build) made count() drop from 1 to 0. Replaced with a fixed toDate('2020-01-01'), which is still a non-const tuple element but timezone-independent. |
|
Workflow [PR], commit [c5e22ee] Summary: ✅ AI ReviewSummaryThis PR removes the wall-clock dependency from Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 77 line(s), 1 function(s) across 36 file(s) · Details Top files
|
CI finish ledger — c5e22eeCI fully finished, fully green (Finish Workflow = success, CH Inc sync = success, all builds/functional/integration/stress/fuzzers pass). No failing tests, nothing PR-caused. The 00612_pk_in_tuple_perf test (the target of this fix, replacing today() with a fixed date to remove the INSERT/SELECT midnight-straddle race) passes across all variants.
Session id: cron:our-pr-ci-monitor:20260701-150000 |
…-in-tuple-perf-today-race Fix flaky test 00612_pk_in_tuple_perf
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes a rare flaky failure of
00612_pk_in_tuple_perf, seen onStateless tests (amd_msan, WasmEdge, parallel, 1/2)and other slow builds.The "non-const args in tuple" section used
today()in both the INSERT (today() - number) and the SELECT ((u, d) IN ((0, today()), (1, today()))).today()is evaluated independently at INSERT time and at SELECT time (separate client invocations). If the wall clock crosses midnight (in the randomized session timezone) between the two,today()@selectdiffers fromtoday()@insert, so row 0 no longer matches andcount()returns 0 instead of 1.rows_readstays 2 because the primary key still selects the same granules foru IN (0, 1), matching the observed CI diff exactly (-1/+0, rows_read unchanged). The 15-25x slowdown of the msan/WasmEdge build widens the INSERT->SELECT window, making the straddle occasionally happen.Replace
today()with a fixedtoDate('2020-01-01'). It is still a non-const function expression (preserving the test's original intent to cover non-const tuple elements), but it is timezone-independent and identical across the INSERT and SELECT, so no midnight race is possible. The.reference(count = 1, rows_read = 2) is unchanged.Reproduced deterministically with
clickhouse local: inserting withtoday = 2020-06-15then selecting withtoday = 2020-06-16yieldscount() = 0, rows_read = 2(the exact CI diff); the fixed version returnscount() = 1, rows_read = 2under both the default and theAmerica/Hermosillosession timezone. 50/50 passes throughclickhouse-testwith randomization enabled.CI report of the failure this fixes: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109011&sha=4531517ba0a51a968862bc9d6e085733de02e91b&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20WasmEdge%2C%20parallel%2C%201%2F2%29
Version info
26.7.1.371(included in26.7and later)