Repository navigation
Mark 04411_memory_profiler_sample_probability as no-llvm-coverage - #116242
Conversation
04411_memory_profiler_sample_probability_sql_settings runs a query with memory_profiler_sample_probability = 1, then SYSTEM FLUSH LOGS trace_log, then asserts a MemorySample row is visible. SystemLogQueue::waitFlush uses a hardcoded timeout_seconds = 180 (src/Common/SystemLogBase.cpp:191) and waits for getLastLogIndex(), a server-global queue position, so the flush drains the trace rows of every concurrently running parallel test rather than only this test's. Under LLVM source-based coverage instrumentation the server is slow enough that this crosses 180 s, waitFlush throws at :213 with Code: 159. Timeout exceeded (180 s) while flushing system log 'DB::SystemLogQueue<DB::TraceLogElement>'. (TIMEOUT_EXCEEDED) and the following SELECT count() > 0 then reads 0, so the coverage lane reports a false negative rather than only contaminating stderr. Over 30 days of coverage-lane runs that PASSED, this test has p50 9.6 s and p95 183.6 s (max 202.3 s) against p50 5.1 s / p95 11.1 s in every other lane, and 2307 of 37648 coverage runs already exceed 180 s. Two crossed it on the flush: Stateless tests (amd_llvm_coverage, 3/3) on 2026-08-20 (PR ClickHouse#115623) and (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) on 2026-07-23 (PR ClickHouse#109174). Report for the 2026-08-20 failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115623&sha=9b52646c82721f24b7dfb1ddc58d949beef5a7d0&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%203%2F3%29 no-llvm-coverage is the established remedy for this mechanism: 36 stateless tests carry it, and commit 36decd6 ("Mark tests that timed out under LLVM coverage as no-llvm-coverage") applied it to five tests including this test's direct sibling 02818_memory_profiler_sample_min_max_allocation_size, whose shape is identical. 04411 was created two months after that commit, which is why it was missed. Coverage is relocated, not lost: the inverse filter at tests/clickhouse-test:2967-2971 makes Stateless tests (amd_binary_excluded_from_llvm) run exactly the tagged complement, and the two flags are mutually exclusive by construction (ci/jobs/functional_tests.py:608-612). Over 14 days in that job the tagged siblings 02818 and 01473_event_time_microseconds are OK 4367 and 4365 times while 04411 is SKIPPED 4367 times. The same intervention on 01473 (ClickHouse#103219, merged 2026-08-04) took its coverage-lane failures from 5 to 0. Raising or parameterizing the 180 s constant was rejected: it is a server-wide change for one test, the constant is already a deliberate concession to parallel-test load, and because the drain is global a larger value only moves the threshold. Validated with the real runner. With the tag, --llvm-coverage skips and --excluded-from-llvm runs; with the tag removed both verdicts invert, which is the liveness proof that the arms measure the tag. Without any coverage flag the test still runs, 10/10. Related: ClickHouse#114204
Internal second-model review (click to expand)Two independent reviews of this change: a cold read of the resulting tree, and a separate
The mechanism was re-verified at source rather than taken from the plan: the 180 s deadline Session id: cron:clickhouse-review-slot-49:20260825-032800 |
Pre-PR validation gate (click to expand)
50/50 randomized runs: N/A and deliberately not run. The change adds no test and alters no Session id: cron:clickhouse-impl-slot-40:20260825-024900 |
|
Workflow [PR], commit [cdb8fb8] Summary: ✅ AI ReviewSummaryThis PR adds the Final Verdict
|
|
cc @alexbakharew, could you review this? It adds |
690d110
Related: #114204
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04411_memory_profiler_sample_probability_sql_settingsruns a query withmemory_profiler_sample_probability = 1, thenSYSTEM FLUSH LOGS trace_log, then assertsthat a
MemorySamplerow is visible. The flush deadline is a hardcodedtimeout_seconds = 180inSystemLogQueue::waitFlush(src/Common/SystemLogBase.cpp:191),and the index it waits for is a server-global queue position, so it drains the trace rows of
every concurrently running parallel test. Under LLVM coverage instrumentation the server is
slow enough to cross 180 s, and the flush throws:
That is not only stderr noise: the following
SELECT count() > 0 ... 'MemorySample'thenprints
0, so the lane reports a false negative.Over 30 days of coverage-lane runs that PASSED, this test has p50 9.8 s and p95 185.5 s
(max 202.3 s) against p50 5.1 s / p95 11.1 s in every other lane, and 2310 of 37668 are
already over 180 s. Two crossed it on the flush:
amd_llvm_coverage, 3/3on 2026-08-20(report)
and
amd_llvm_coverage, ParallelReplicas, s3 storage, parallelon 2026-07-23.no-llvm-coverageis the standing remedy for this mechanism: 36 stateless tests carry it, andthis test's direct sibling
02818_memory_profiler_sample_min_max_allocation_sizewas taggedfor the same reason in
36decd61("Mark tests that timed out under LLVM coverage asno-llvm-coverage"). 04411 was created two months later, which is why it was missed.Coverage is relocated, not lost: the inverse filter in
tests/clickhouse-testmakesStateless tests (amd_binary_excluded_from_llvm)run exactly the tagged complement, where02818 and
01473_event_time_microsecondspass ~4370 times per 14 days while 04411 iscurrently skipped. The test keeps running unchanged in every non-coverage lane. One residual,
shared with all 36 tagged tests: the per-test coverage job also passes
--llvm-coverage, sothis test's per-test attribution is dropped too.
Tag/flag matrix (local runner, Build-ID verified server)
--llvm-coverage[ SKIPPED ] 0.00 sec--excluded-from-llvm[ OK ] 5.54 sec--llvm-coverage[ OK ] 1.14 sec--excluded-from-llvm[ SKIPPED ] 0.00 sec[ OK ] 1.04 secWith the tag removed both verdicts invert, so the probe measures the tag rather than an
unrelated skip reason.
Prior art on the identical intervention: #103219 tagged
01473_event_time_microseconds(merged 2026-08-04); its coverage-lane failures over 120 days are 5 before that instant and
0 after. 02818 has none in the last 120 days either; its last ones are from the day it was
tagged.
Workflow [PR]
Sync PR [sync-upstream/pr/116242]
Version info
26.9.1.66(included in26.9and later)