Repository navigation
Skip 01473_event_time_microseconds under LLVM coverage builds - #103219
Conversation
Pre-PR validation gatea) Deterministic repro? b) Root cause explained? c) Fix matches root cause? d) Test intent preserved? e) Demonstrated in both directions? f) Fix is general, not a narrow patch? Session: |
|
cc @alexey-milovidov — could you review? This follows the exact pattern of your commit |
|
Workflow [PR], commit [2fd96d9] Summary: ✅ AI ReviewSummaryThis PR only adds the Final Verdict✅ Approve. No review findings. |
The test issues `SYSTEM FLUSH LOGS /* all tables */`, which triggers flushing every system log (including `trace_log`) and must wait for the shared backlog accumulated by all parallel tests on the same server. Under LLVM source-based coverage instrumentation the per-branch profiling overhead accumulated in the `trace_log` queue pushes the server-side `waitFlush` call past its 180s timeout in `SystemLogBase.cpp`, producing: Code: 159. DB::Exception: Timeout exceeded (180 s) while flushing system log 'DB::SystemLogQueue<DB::TraceLogElement>'. (TIMEOUT_EXCEEDED) This is the same failure mode that `01473_event_time_microseconds` hits on the same build variant. 30-day CIDB shows 7 failures across 6 unrelated PRs (~0.056% on amd_llvm_coverage, 0 master failures on amd_llvm_coverage). The test verifies sorting-key correctness for system tables — a property that has nothing to do with coverage instrumentation — so skipping on `amd_llvm_coverage` preserves the test's ability to catch regressions on every other build variant. Follows precedent of `01473_event_time_microseconds` (PR ClickHouse#103219), sibling query-profiler tests `00974_query_profiler`, `01569_query_profiler_big_query_id`, and commit cec04c1 (Kafka tests under coverage). Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100777&sha=4892bb02456a3a49a0a21553f684b664020674c9&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%203%2F3%29
…n amd_llvm_coverage Adds `no-llvm-coverage` tag — under LLVM source-based coverage instrumentation the server is ~3-5x slower, and with `memory_profiler_sample_probability = 1` the test emits many `MemorySample` trace rows. The server-side `SystemLogQueue<TraceLogElement>` flush then routinely exceeds its 180s deadline, emitting `Code: 159 TIMEOUT_EXCEEDED` into stderr and causing the `clickhouse-test` stderr-empty check to report the test as `FAIL` even when the assertion output itself is correct. CIDB evidence (30 days): - 34 failures, 25+ distinct unrelated PRs, 4 master hits — all on `amd_llvm_coverage` variants only (1/3, ParallelReplicas+s3+parallel, AsyncInsert+s3+parallel). - Zero failures on debug, asan_ubsan, tsan, msan, release, binary builds in the same window. - Health check: in 7 days the test has 657-706 OK runs on each of the 4 coverage variants (so it passes most of the time; 180s deadline is a rare stochastic trip). Same pattern and fix as the recent sibling coverage flakes: ClickHouse#103287, ClickHouse#103288, ClickHouse#103293, ClickHouse#103298, ClickHouse#103226, ClickHouse#103219. Closes the `ci-02818memoryprofilersampleminmax` chronic-flaky tracking task.
|
@groeneai, I've fixed the test |
The test issues SYSTEM FLUSH LOGS on metric_log, trace_log, query_log, and query_thread_log, then verifies event_time_microseconds accuracy. Under LLVM source-based coverage instrumentation, flushing trace_log alone can exceed the 180s server-side waitFlush timeout (SystemLogBase.cpp:185), producing: Code: 159. DB::Exception: Timeout exceeded (180 s) while flushing system log 'DB::SystemLogQueue<DB::TraceLogElement>'. (TIMEOUT_EXCEEDED) The test already excludes all sanitizer builds and debug builds for exactly this kind of timing-sensitivity reason. Add no-llvm-coverage to cover the remaining instrumented variant. Same pattern as sibling query-profiler tests (00974_query_profiler.sql, 01569_query_profiler_big_query_id.sh) and follows precedent of commit cec04c1 (Kafka tests under coverage). 30-day CIDB: 4/6044 failures on 'Stateless tests (amd_llvm_coverage, 2/3)', 0 master failures. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103209&sha=568958afaab08561c6c2a0a13a08f1b7486bbc8a&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%202%2F3%29
770ff6f to
1055e7e
Compare
|
@alexey-milovidov branch rebased onto current master ( Session: |
The test relies on a precise memory-tracking cadence between two distributed
shards: the shard allocating `groupArray(repeat('a', 100000))` per row must
hit `max_memory_usage=1G` and emit `Query memory limit exceeded` before the
other shard cancels. Under LLVM source-based coverage instrumentation the
per-branch profiling overhead perturbs this cadence and the expected exception
occasionally does not surface on `127.3` before the query is cancelled,
producing an empty `grep` match and a FAIL.
30-day CIDB at the time of the fix: 7 hits on `Stateless tests
(amd_llvm_coverage, 1/3)` across 7 distinct PRs, 1 master hit on 2026-04-21,
2 hits on the `amd_llvm_coverage, AsyncInsert, s3 storage` variant, 0 hits on
any non-coverage stateless configuration.
Applies the same direction as sibling coverage-timing tests
`03096_order_by_system_tables` (ClickHouse#103226, merged) and
`01473_event_time_microseconds` (ClickHouse#103219). The test remains covered by all
non-coverage configurations and by the excluded-from-llvm runner variant that
specifically runs tests tagged `no-llvm-coverage`.
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=99c45393710200ab19c3ff17b45badf63b466559&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%201%2F3%29
Co-Authored-By: Claude Opus 4.8 <[email protected]>
CI finish ledger — a691b58CI fully finished (Finish Workflow: success). This PR is a 6-line test-tag change (add
Session id: cron:our-pr-ci-monitor:20260630-163000 |
|
Fixing PR for the |
|
Re-synced onto current `master` (merge commit `756cd20`) to re-run CI. The only red on the previous run (`a691b581`) was a job-level infra error on `Stateless tests (amd_llvm_coverage, old analyzer, s3 storage, DatabaseReplicated, WasmEdge, parallel)` — the container was torn down mid-job (`Error waiting for container: Canceled: grpc: the client connection is closing: context canceled`), with all per-test reruns passing (33/33). That was the runner-lease overrun on the un-batched slow coverage variant, which #108970 fixes by splitting the job into batches. #108970 merged into `master` on 2026-07-01, after this PR's last CI run, so this re-sync pulls the batching fix into the branch history. A fresh run of the coverage variant should now finish inside its lease and unblock the PR. The change itself is unchanged — the same 6-line `no-llvm-coverage` tag addition (AI Review: Approve). |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 92 line(s), 4 function(s) across 44 file(s) · Details Top files
|
|
@alexey-milovidov this
It recurs on current master across unrelated runs (9 distinct PRs + 1 master hit in 30d, all single hits). Root cause: with I already have a fix in flight: #109393 (Fix LOGICAL_ERROR in full_sorting_merge JOIN when sharding stream counts diverge). It targets exactly this stack. Once it merges this failure goes away. |
|
Re-synced onto current The only test red on the previous run ( All |
|
Fresh CI on `fbd0fc73352` confirms the re-sync worked:
The only remaining red is `Stress test (amd_debug)`: an AST-fuzzer `Logical error: Inconsistent KeyCondition behavior` (STID `5182-684a`). This is a chronic, unrelated AST-fuzzer flaky tracked by #107951 — it hits `master` and dozens of unrelated PRs, and cannot be caused by a test-tag-only change. No action needed here. |
CI finish ledger - fbd0fc7Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
This PR adds a Session id: cron:our-pr-ci-monitor:20260725-163000 |
CI finish ledger - 2635b3aEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
Fast test, Fast test (arm_darwin) and Style check are all green on this head, so neither line is caused by this PR's diff. Session id: cron:our-pr-ci-monitor:20260726-163000 |
CI finish ledger - 2fd96d9CI is fully finished on this head and there is nothing to own: 175/175 check-runs completed, 48 success, 127 skipped, 0 failures.
Verified from the paginated check-runs API rather than the status rollup, which truncates on this repo. I am not re-pinging reviewers. Session id: cron:our-pr-ci-monitor:20260803-163000 |
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
The test
01473_event_time_microsecondsissuesSYSTEM FLUSH LOGSonmetric_log,trace_log,query_log, andquery_thread_log, then verifiesthat
event_time_microsecondsmatchesevent_timein each system log. UnderLLVM source-based coverage instrumentation, flushing
trace_logalone canexceed the 180s server-side
waitFlushtimeout (SystemLogBase.cpp:185),producing:
30-day CIDB on
Stateless tests (amd_llvm_coverage, 2/3): 4 fails / 6044 runs,all timing out on
SYSTEM FLUSH LOGSafter ~180s. Zero master failures; test ishealthy on non-coverage variants.
The test already excludes every sanitizer build and the debug build for exactly
this kind of timing-sensitivity. Adding
no-llvm-coveragecloses the remaininggap. This mirrors sibling query-profiler tests
00974_query_profiler.sqland01569_query_profiler_big_query_id.sh, and follows the precedent set by commitcec04c17241(Kafka tests under coverage).The test will still run on release, binary, Fast test, and
amd_binary_excluded_from_llvmvariants — so coverage of this code path ispreserved.
CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103209&sha=568958afaab08561c6c2a0a13a08f1b7486bbc8a&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%202%2F3%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.8.1.718(included in26.8and later)