Skip to content

Report the exception in the performance comparison Run Errors table and count tests, not rows - #116491

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-run-errors-ripgrep-dialect
Sep 20, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-run-errors-ripgrep-dialect

Conversation

@groeneai

@groeneai groeneai commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed the Performance Comparison check reporting a single failing performance test as ten errors, and made its Run Errors table show the exception instead of the top of the traceback.

Description

A failing performance test is reported as 10 errors, and the ten rows it puts in the
report's Run Errors table are the first ten lines of a Python traceback, never the exception
line at the bottom. In the 30 days to 2026-08-26 the errors term reds 141
Performance Comparison (*, master_head, *) runs across 46 pull requests, plus 9 runs on
master whose message begins with exactly 10 errors.

Root cause: compare.sh extracts the blurb with rg, but both selective patterns were written
in GNU basic-regex syntax (\(, \|, \+). ripgrep's dialect reads those escapes as the
literal characters (, |, +, so neither can match a traceback. They are valid regexes, so
rg exits 1 rather than erroring and the || chain silently falls through to head -10. In
the CIDB sink default.perf_run_errors_v1 that is, as of 2026-08-26, 345,880 groups of exactly
ten rows per run and test and zero of one or two, though --max-count=2 emits at most two.

I delete six backslashes, and count distinct tests rather than rows in report.py, which is
what the error_tests name already claimed.

This cannot turn a red shard green: head -10 is kept and rg exiting 1 still falls through,
so a non-empty error log still yields at least one row, and report.py hardcodes the plural
" errors" for every count, so the substring gate in performance_tests.py still fails the
shard on 1 errors. Only the number and the text change.

Validated against the artifacts of one real failing job:
beforehand my local run reproduces its 10 errors, 11 too long, 4 unstable byte-for-byte,
afterwards the same inputs give 1 errors, ... and the table holds the two lines naming the
timeout. CI-script tests are throwaway per .claude/CLAUDE.md, and ci/tests is being removed
in #115650.

Related: #109409


Workflow [PR]
Sync PR [sync-upstream/pr/116491]

compare.sh picks one error blurb per failing performance test with a
three-tier fallback: match a line naming an exception, else a line of the
"socket.timeout: timed out" shape, else the first ten lines of the log.
Both selective patterns were written in GNU basic-regex syntax, with
escaped grouping, alternation and quantifier, but they are executed by
ripgrep, whose dialect reads those escapes as the literal characters
"(", "|" and "+". Tier one therefore searched for the literal text
"(Exception|Error):" and tier two for one non-space followed by a literal
plus, a colon and a space. Neither can match a Python traceback.

The patterns are valid regexes, so ripgrep exits 1 for "no match" rather
than 2 for "bad pattern", and the || chain silently took head -10 on
every failing test. head -10 captures the TOP of a traceback, so the
exception at the bottom was never recorded. Deleting six backslashes
restores the original intent: basic-regex \(A\|B\):[^:] and rust-regex
(A|B):[^:] are the same language, as are ^[^ ]\+: and ^[^ ]+: .
ripgrep has no POSIX-basic mode, so no flag makes the old spelling mean
what it said.

head -10 then emitted ten lines, sed prefixed each with the test name,
and report.py did error_tests += len(run_error_rows), counting rows under
a name that says tests, so one failing test scored ten. Counting distinct
test names makes the variable's name true.

Measured in default.perf_run_errors_v1, the sink for run-errors.tsv:
345,311 groups of exactly ten rows per (run, test) and zero groups of one
or two, even though --max-count=2 can only ever emit one or two, so the
selective tiers had never once fired. In the 30 days to 2026-08-26 the
"errors" term reds 142 Performance Comparison master_head runs across 47
pull requests, plus 9 runs on master whose message begins with exactly
"10 errors". Of the release_base rows, 113,800 of 113,810 are argparse
usage text while zero contain the "unrecognized arguments" line that
actually names the defect; that line matches tier two.

This cannot turn a red shard green. head -10 is kept and a ripgrep exit
of 1 still falls through, so a non-empty error log still yields at least
one row, and report.py hardcodes the plural " errors" for every count, so
the substring gate in performance_tests.py still fails the shard on
"1 errors". Only the number and the text change.

Verified on the artifacts of a real failing job (PR ClickHouse#109409, arm_release
master_head 4/6): before the change, running report.py in that run's
extracted working directory reproduces its own message
"10 errors, 11 too long, 4 unstable" byte for byte, and the extraction
block reproduces its run-errors.tsv byte for byte; after the change the
same inputs give "1 errors, ..." and two rows naming the ServerException
and the 300 s timeout. Per .claude/CLAUDE.md the tests for a CI script
change are throwaway and not committed, and ci/tests is being removed in
Remove ci/tests (attempt 2).

Related: ClickHouse#109409

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Aug 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex): 0 findings. One nit from my own
cold read of the diff, recorded here because it is the only non-obvious line in the change:

# Sev Finding Verdict Evidence / action
1 💡 if row at report.py:396 guards a run-errors.tsv row shape that cannot occur DISAGREE Both writers pipe through a sed that always emits a tab, so csv.reader never yields an empty row; the guard only preserves the tolerance the len() it replaces already had, and without it an IndexError would cost the whole report.html

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence
and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20260826-105700

@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7dfc7c1]

Summary: ✅


AI Review

Summary

This PR fixes the Performance Comparison run-error reporting path in two places: compare.sh now uses ripgrep-compatible regex syntax when extracting exception lines from *-err.log, and report.py now counts distinct failing tests instead of raw run-errors.tsv rows when composing the status message. I reviewed the current diff, the surrounding producer/consumer code for run-errors.tsv, and the existing PR discussion, and I did not find a remaining correctness or contract gap in the current head.

Final Verdict

✅ No new findings in the current head. I would approve this change pending normal CI completion.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @azat, could you review this? Both selective rg patterns in compare.sh were written in GNU basic-regex syntax, so ripgrep read the escapes as the literal characters (, |, +, every failing performance test fell through to head -10, and that is what makes one failing test report as 10 errors.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 7dfc7c1

CI is fully finished at this commit and no check failed, so no ledger row is owed.

Evidence: no check queued or in progress; Config Workflow, Style check and Finish Workflow all
green; praktika result_pr.json reports the root as OK over 176 nodes, 13 OK and 163
SKIPPED, with zero dropped and zero failing leaves out of 175. The 163 skips are digest skips
from a CI-script-only diff, and every one of the 13 jobs that diff does affect ran, including all
six Performance Comparison (arm_release, master_head, N/6) shards, which are the jobs this
change validates itself in. A CIDB query at this commit, filtered against the measured
healthy-token set, returns zero non-green rows against a control of 7,244 rows at the same
commit, so that zero is a real filtered subset rather than an empty query. The eight remaining
non-OK rows are Performance Comparison per-query unstable verdicts on ::old/::new pairs
whose shards report success, which is a review-class token rather than a failure.

Session id: cron:our-pr-ci-monitor:20260826-143000

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 19, 2026
Merged via the queue into ClickHouse:master with commit 3527197 Sep 20, 2026
190 of 192 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants