Repository navigation
Report a tolerated do_not_check_in_pr setup failure on stdout, not the test's stderr - #122135
Conversation
…e test's stderr tests/performance/README.md documents the reference-side opt-out for setup queries: when a query marked do_not_check_in_pr fails on the reference server, the remaining setup queries are skipped there, the test runs on the new server only, and its queries are reported under "Backward-incompatible queries" instead of failing the check. perf.py writes the tolerated failure's diagnostic to the test's stderr twice: once in the tolerate branch, and then once per query, because the prewarm loop seeds query_error_on_connection from setup_error_on_connection so every query of the test inherits that connection's error. Whichever runner persists that stderr turns it into run-errors.tsv rows (compare.sh:1767-1777), which report.py:396 counts into error_tests. The two runners differ, and the difference decides what the bug is. The CI job keeps a test's stderr only when perf.py exits non-zero, gated by if res != 0 in CHServer.run_test (ci/jobs/performance_tests.py:1291-1293), and it enters compare.sh at stage=get_profiles (performance_tests.py:2557, the only compare.sh invocation in ci/), which the case fall-through at compare.sh:2010-2028 makes skip run_tests entirely. So in CI a tolerated failure alone exits 0, writes no *-err.log, and does not fail the check by itself; what it does instead is hide the error that did: the tolerated diagnostic is written at setup, so it is first in the log, and the sweep keeps only a prefix of that log -- the first two rg --max-count=2 matches (compare.sh:1773-1774), or the first ten lines when it falls back to head -10 (compare.sh:1775) -- while the real failure sits far below it. The standalone stage=run_tests flow, which compare.sh:268-275 names together with the manual README flow, redirects every test's stderr unconditionally (compare.sh:557), and there a tolerated-only failure does fail the run, contradicting README.md:66. Both halves are live on PR ClickHouse#113575, a do_not_check_in_pr user. On its 09-17, 09-18 and 09-23 runs the Run Errors table for codecs_float_wallaby_insert shows the deliberately tolerated Code: 115 "Setting enable_wallaby_codec is neither a builtin setting ..." from perf.py:827 in do_create, while the failure that actually ended the run sits in the same err.log: Code: 159, "Timeout exceeded" on codecs_float_wallaby_insert.query2.run0, about 15.1 s against the 15 s limit on each of the three runs, from the measured-run loop. The author is shown the one thing the harness decided to tolerate and not the timeout that needs the attention. The diagnostic now goes to stdout once, emitted from the main thread after the create threads are joined, as a structured tolerated-setup-error line. Every thread is joined before that line is emitted, even when one of them fails, so a fatal setup failure on a non-reference connection no longer discards the tolerated connection's queued diagnostic. It is printed from the main thread on purpose: do_create runs in SafeThreads, a print of a long string is more than one write, and a torn line would corrupt the raw .tsv that compare.sh parses by leading tag. The reason therefore survives in the archived per-test raw .tsv, which is the artifact that is uploaded, and it survives a failing run too, since performance_tests.py:1294-1295 writes stdout to that .tsv unconditionally. The affected queries remain visible under "Backward-incompatible queries", the destination both READMEs name. The tag is additive: every existing reader of the raw .tsv is a tag-keyed filter, so none of them matches it, and an older compare.sh paired with this perf.py simply ignores the line. The per-query dump no longer repeats an error a connection merely inherited from a tolerated setup query. setup_error_on_connection[i] is None is exact rather than a heuristic: a connection carrying a tolerated setup error is never retried by the prewarm loop, so that entry can never be overwritten by a different error, and a non-None value there means precisely "this is the tolerated setup error". An error a query produced itself still goes to stderr, where whichever runner persists it reports it; only the shell arm raises. Deliberately unchanged, each an alternative that was considered and rejected: a reference-only <query type="shell"> failure stays fatal, because it is not provably version skew (a timeout or a killed process group arrives through the same channel) and do_not_check_in_pr is already refused on tests containing shell queries; a generic reference-only SQL prewarm failure is still written to stderr, since reporting every prewarm error is long-standing and deliberate; no new report table is added, because the documented destination for these rows already exists and already renders them correctly; and compare.sh's stderr sweep is left alone, since it correctly reports genuine errors and the fix removes the tolerated text from its input instead. Validated against two servers built from one binary, made asymmetric by a user-defined function created only on the new one, which is the case the README describes, with compare.sh's own Run Errors construction applied verbatim, so the numbers below describe the standalone flow. Running the same test with the pre-change and post-change perf.py takes the test's stderr from 9312 bytes and error_tests=1 to 0 bytes and error_tests=0, while the exit code stays 0 and both queries keep their partial rows. In the CI runner the effect is different in kind: a run whose only stderr was the tolerated diagnostic already exits 0 and is already green, so no shard turns green, and what changes is that the Run Errors row for a test that failed for another reason now carries that reason. Six mutation arms confirm the narrowing: an untolerated setup failure, a non-matching --pr-number, a failure on a non-reference server and a reference-only shell failure all still fail the check in either runner; a query's own reference-only failure still reaches stderr and still reds the standalone run; and an ordinary healthy test is undisturbed. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model reviewAn independent model reviewed this change cold, without the author's evidence, and a gate re-reviewed it ❌ Blocker (agreed, fixed): the stated failure mechanism did not hold in the CI path. The change was
✅ Disagreed, with evidence, no change made. The new Checked and found sound. The suppression predicate is exact rather than heuristic, because the prewarm Residual, pre-existing, not addressed here: |
|
Workflow [PR], commit [c7e16e7] Summary: ✅
AI ReviewSummaryThis PR moves tolerated Final Verdict✅ No new findings. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required (CI fix).
Description
Related: #113575
Failing job: https://github.com/ClickHouse/ClickHouse/actions/runs/35807652672/job/107188619622
tests/performance/README.md:66: when a setup query markeddo_not_check_in_prfails on thereference server, the test runs on the new server only and its queries go under
"Backward-incompatible queries" instead of failing the check.
perf.pywrites that diagnostic to the test's stderr: in the tolerate branch, then once perquery, since every query inherits the connection's setup error. What it costs depends on the runner.
CI keeps a test's stderr only when
perf.pyexits non-zero (CHServer.run_test,ci/jobs/performance_tests.py:1291-1293) and enterscompare.shatstage=get_profiles, whosecasefall-through skipsrun_tests, so a tolerated-only failure cannot fail the check there. Thestandalone
stage=run_testsflow, which is also the README's own, redirects unconditionally(
compare.sh:268-275,compare.sh:557), and there it does. Hence two defects:tolerated
enable_wallaby_codecsetting error in Run Errors forcodecs_float_wallaby_insert,while the same
-err.logalso carries a 15 sCode: 159 Timeout exceededonquery2. Thetolerated text is written first, at setup, and the sweep keeps only a log prefix (two
rgmatches,or
head -10), so the timeout never reaches the table. This PR does not green that shard; thetimeout is Add experimental Wallaby floating-point compression codec #113575's own.
README.md:66.The diagnostic now goes to stdout once as a
tolerated-setup-errortag, which survives in thearchived raw
.tsveven for a failing run, and the per-query dump no longer repeats an error aconnection merely inherited.
Unchanged on purpose: a reference-only
<query type="shell">failure still raises, and an error aquery produced itself is still written to stderr and still reported by whichever runner persists
it. Pre-existing residual:
compare.sh'shead -10fallback turns any non-empty test stderr intoRun Errors rows.
Workflow [PR]
Sync PR [sync-upstream/pr/122135]
Version info
26.10.1.730-master(included in26.10and later)