Repository navigation
Fix flaky test 03821_drop_workload_during_query_race - #126345
alexey-milovidov merged 1 commit into
Conversation
Since ClickHouse#123341, DROP WORKLOAD purges the dropped workload's queue, so a racing query that still links to it fails with INVALID_SCHEDULER_NODE when it allocates CPU. The test expects that code, but filtered the client output line by line with `grep -v`. A failed query also prints the server's error log, forwarded by --send_logs_level=warning, with its stack trace, plus the client's "Received exception from server" and "(query: ...)" lines. Only the lines that carry the code were dropped, so the stack frames reached stdout and the runner reported "having exception in stdout". Capture each query's whole output and print it only if it contains none of the expected codes. Any other output still fails the test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (click to expand)Own cold review + Gate B (codex) on
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261016-172600 |
|
Workflow [PR], commit [741c1e5] Summary: ✅ AI ReviewSummaryThis PR fixes false failures in Final VerdictStatus: ✅ Approve |
use_skip_indexes_if_final_exact_mode recovery pass
#126575
|
The 26.10 backport of #123341 (#127462) merged on 2026-10-22, but this test fix is not on 26.10, and the test now fails there with the signature fixed here: 26.10 CI report ( Could |
Backport #126345 to 26.10: Fix flaky test `03821_drop_workload_during_query_race`
Backport #126345 to 26.9: Fix flaky test `03821_drop_workload_during_query_race`
Backport #126345 to 26.8: Fix flaky test `03821_drop_workload_during_query_race`
Related: #123341
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Stateless tests (arm_binary, s3 storage, DBReplicated, sequential)on master663364fe5effailed withhaving exception in stdout: the stack frames ofRequestQueue::enqueueRequest<-CPULeaseAllocation, then the client'sReceived exception from serverand(query: ...)lines.Since #123341,
DROP WORKLOADpurges the dropped workload's queue. A racing query that still holds a link to that queue now fails withINVALID_SCHEDULER_NODEwhen it allocates CPU. That is intended (DropWorkloadFailsPendingRequestsin #123341 expects the throw), and the test already lists this code as expected. But the test filtered the output line by line withgrep -v. A failed query also prints the server's error log (forwarded by--send_logs_level=warning) with its stack trace, plus the client's header and query lines, and only the lines that contain the code were dropped. Before #123341 no racing query failed, so the broken filter never showed.Now
thread_querycaptures each query's whole output and prints it only if it contains none of the expected codes. The expected codes are unchanged, and any other output still fails the test.Validation (debug build of master with #123341, 300 sequential randomized runs per arm):
query_loghas a query failed with code 672. On a master build from before Fix possible crash due to use-after-free of memory reservation after DROP WORKLOAD #123341: 300/300 OK, no such query.Workflow [PR]
Sync PR [sync-upstream/pr/126345]
Version info
26.11.1.185-master(included in26.11and later)26.10.3.23