Repository navigation
Make test_parking_fires_on_idle_worker actually sleep - #127780
alexey-milovidov merged 1 commit into
Conversation
The test needs a serial sleepEachRow(0.5) phase in which the other pipeline workers have no task and park their CPU lease in the idle wait. The outer aggregate was count(), which reads no column, so the analyzer's RemoveUnusedProjectionColumnsPass removed both sleepEachRow projections and the query read 90 numbers in a few milliseconds. The test then passed only when a second worker happened to reach the idle wait before the query ended, and failed with 0 parks otherwise (Integration tests (arm_binary, 3/4) on PR ClickHouse#127761). CIDB: 5391 OK runs in 30 days with a median test time of 437 ms, so the sleeps never ran in CI. Read the sleep column with sum(s) so the sleeps are kept (about 7 s, the idle window the comment describes), and assert SleepFunctionCalls == 90 before the parks asserts so the test fails if the premise is ever optimized away again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261025-143700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261025-140200 |
|
cc @serxa, could you review this and add the |
|
Workflow [PR], commit [41a612d] Summary: ✅ AI ReviewSummaryPR #127780 fixes the idle-worker parking test by consuming the Missing context / blind spots
Final VerdictStatus: ✅ Approve. No changes requested. |
|
Seems good. Ping me when mergable |
ce88c15
Related: #117711
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_scheduler_cpu_parking/test.py::test_parking_fires_on_idle_workerfailed withexpected parks > 0, got 0in Integration tests (arm_binary, 3/4) on #127761, whosewide_integerchange does not touch the scheduler.The test needs a serial
sleepEachRow(0.5)phase in which the other pipeline workers have no task and park their CPU lease in the idle wait. The outer aggregate iscount(), which reads no column, so the analyzer'sRemoveUnusedProjectionColumnsPassremoves bothsleepEachRowprojections:EXPLAINshows onlyReadFromSystemNumbers, and the query reads 90 numbers in about 4 ms. The test then passes only when a second worker happens to reach the idle wait before the query ends. In CIDB the test passed 5391 times in 30 days with a median of 437 ms, so the sleeps never ran in CI.The change uses
sum(s)oversleepEachRow(...) as s, so the sleeps are kept and the query gets the serial window the comment describes (about 7 s in total), and assertsSleepFunctionCalls == 90before the parks asserts, so the test fails if the premise is optimized away again.Validation on the master debug and ASan builds in the integration harness: with only the new assertion, the old query fails 3/3 with
expected 90 sleep calls, got 0. With the change, 33 debug runs (four random-settings draws) and 10 ASan runs pass with 8 parks and 8 unparks each, a further 50 debug runs pass, and the whole module passes.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127780]
Version info
26.11.1.779-master(included in26.11and later)