Repository navigation
Do not report "Server died" for a signal-killed run with no failure - #112952
alexey-milovidov merged 6 commits into
Conversation
`ABORTED_RUN_EXIT_CODES` synthesizes a "Server died" FAIL leaf for any death-by-signal of the test command, so a run that was killed externally is reported as a server crash even when nothing observed one. On PR ClickHouse#108676 / Stateless tests (amd_tsan, parallel) the report read "Failed: 0, Passed: 10564, Skipped: 171" with "Server died" as the only failure: three tests completed [ OK ] in the final two seconds before the kill, the server then answered "system flush logs" and stopped cleanly under --do-not-kill, and the job log had zero <Fatal>, zero "Received signal" and a clean dmesg. Measured over 30 days, 53 stateless and fast test jobs across 49 PRs carry that leaf with no other failing row. The exit code establishes only that the run was killed, never by whom, so when the parser observed no failure at all the honest verdict is that the cause could not be attributed. Report ERROR with a leaf naming what was actually observed instead of asserting a cause. The job stays red either way (neither FAIL nor ERROR is in `Result.is_ok`), so for a normal job this only changes the wording. ERROR rather than FAIL because `invert_bugfix_validation_status` flips any FAIL row to OK without inspecting its name, which would turn an exit code into a claimed bug reproduction. ERROR is the existing inconclusive channel, and `reconcile_bugfix_crash_repro` still downgrades ERROR to FAIL when a BLOCKER fatal is present, so a genuine crash keeps validating (ClickHouse#105789). The gate reads the summary counters rather than filtering rows through `is_failure()`: a [ NOT_FAILED ] row increments `failed` but is stored with a status string that `is_failure()` does not match, so filtering rows would reclassify a run whose failure was reported. `STOP_TESTING_EXIT_CODE` is deliberately excluded, since the parent raising `StopTesting` did observe a reason to stop. Related: ClickHouse#106183
The previous commit set the aggregate to ERROR as well as the leaf. That is inert where the signature mostly fires and a regression where it is not. `Result.is_failure` is `status in (FAIL, XPASS)` and excludes ERROR, so an ERROR job result cannot take the non-blocking branch in `praktika/runner.py`, which then emits `pipeline_status=failure` and skips every dependent job. `functional_tests.py` also gates coverage collection on `not test_result.is_error()`. Measured against master on the same fixture: `per_test_coverage` went from FAIL/coverage/success to ERROR/no coverage/failure, and Fast test lost coverage collection. On a stateless job it does not even survive - `CHECK_ERRORS` calls `extend_sub_results`, whose `_update_status` has no ERROR branch and recomputes any non-ok child to FAIL. Keep the aggregate at FAIL and leave ERROR on the leaf alone. The bugfix inverter's inconclusive guard is per-row (`any(r.status == ERROR ...)`), so the leaf is what it reads, and `reconcile_bugfix_crash_repro` still rewrites ERROR rows on a BLOCKER fatal, so a genuine crash keeps validating (ClickHouse#105789). All three carriers now match master; only the leaf name and status change. Also parameterize the no-failure test over all four exit code encodings: both SIGKILL forms were declared in the set but unpinned, and deleting them left the whole suite green while 137 and -9 fell back to "Server died". The leaf info no longer points at the `Check errors` stage. Fast test carries 36 of the 53 measured jobs and has no such stage, so on most hits that hint resolved to nowhere.
The block explaining the inverter's per-row guard ran to four lines. `.claude/CLAUDE.md` and repeated maintainer asks cap an added comment block at three.
Internal second-model review (click to expand)Two review rounds by a model independent of the one that wrote the change, plus a Round 1: ❌ blocker (fixed here) The first draft set the job result to Round 1:
Round 1: The gate diagnosed the same status-recompute mechanism but prescribed preserving Round 2: Both were countable claims that had gone stale as the rolling 30-day window moved, and both Round 2: 💡 noted, not blocking
Verified clean in round 2, by reading the code rather than the change's own notes: Session id: cron:clickhouse-review-slot-51:20260801-205300 |
Pre-PR validation gate (click to expand)
Two mutations are worth naming, because each pins a claim that would otherwise be A 50 by 50 randomized run does not apply and was not skipped silently: the change is Session id: cron:clickhouse-impl-slot-40:20260801-202622 (rows d and f re-measured by review, session id |
|
cc @leshikus @maxknv, could you review this? It narrows the |
|
Workflow [PR], commit [a15ffe9] Summary: ✅ AI ReviewSummaryThis PR narrows Tests
Final Verdict
|
CI finish ledger - b7342e2CI is fully finished and there are no failures to own.
174 check-runs: 16 success, 158 skipped, 0 queued/in_progress. Moving to review. Session id: cron:our-pr-ci-monitor:20260802-053000 |
Master's ClickHouse#115080 added HUNG_CHECK_EXIT_CODE to ABORTED_RUN_EXIT_CODES and a per-code leaf selection, which conflicted textually with this branch splitting the kill-by-signal codes into their own set. Resolution keeps both: KILLED_BY_SIGNAL_EXIT_CODES holds only the four signal encodings, and ABORTED_RUN_EXIT_CODES is derived from it plus both in-band codes, so exit 2 and exit 5 keep their own branches and leaves. The two test suites were disjoint additions on a shared prefix and are both retained. Verified after the merge: the four signal encodings take the new branch, while exit codes 2, 4, 5 and 3 each still take their own master path (no dead branch, no double handling), and the 23 remaining ci/tests/ failures are byte-identical to a pristine master tree (no clickhouse binary in PATH).
The auto-revert job reads SYNTHETIC_TEST_NAMES to tell an aborted run from a completed one, so a synthetic leaf missing from that set makes a truncated run look like green evidence. Add the new name, pinned by a test. Also pin the second half of the gate: an `[ UNKNOWN ]` row increments `unknown` rather than `failed`, so only `s.unknown == 0` sees it. Both new arms were mutation-checked: deleting the guard, or the set member, reddens exactly the test that covers it. Reword two comments that a merged master made stale - the pipeline status no longer keys on `is_failure`, and coverage collection is the reason the ERROR stays on the leaf - and drop the `f()` prose form per the repository convention.
|
Merged master and resolved the conflict in Master's #115080 added Verified after the merge, since a merge can leave a branch reachable but inert: exit 143, Two things the merge surfaced, now fixed here:
Both new assertions are mutation checked: removing the guard, or the set member, reddens Out of scope and not changed: the |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
Master removed the whole `ci/tests` directory in `5b3d66b1a66` ("Remove ci/tests
(attempt 2)", 51 files, no replacement location), so this branch's edits under
`ci/tests` arrive as modify/delete conflicts. Accepted the removal, and dropped
the files this branch adds there as well - keeping them would re-create a
directory master deliberately deleted.
The product change this pull request is about is unaffected; what is lost is its
CI-side unit coverage, which has nowhere to live upstream any more.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| Result("Some queries hung", Result.Status.FAIL, info="Some queries hung") | ||
| ) | ||
| elif ( | ||
| runner_exit_code in KILLED_BY_SIGNAL_EXIT_CODES |
There was a problem hiding this comment.
The last head commit (a15ffe94) accepts the deletion of ci/tests and drops the parser tests this PR originally added, but this branch still changes the classification here from Server died to Test command killed by signal. That leaves the new behavior unproved in-tree: there is no upstream test covering the four SIGTERM/SIGKILL encodings, the STOP_TESTING_EXIT_CODE / [ NOT_FAILED ] / [ UNKNOWN ] guards, or the SYNTHETIC_TEST_NAMES update in revert_ci_regressions.py. Please re-home those parser-level tests into a supported test location, or add equivalent automated coverage, before merging.
There was a problem hiding this comment.
Agreed on the fact: after the master merge nothing in-tree covers this classification. The remedy has no target though, because master removed the only executed home for a Python test of ci/ code.
Measured on 2ae8a25af17523f:
ci/jobs/ci_tests_job.pyis gone (8ff3720644b2, "Remove theCI Testsjob along withci/tests"), andci/defsandci/workflowsdefine no such job.tests/cihas notest_*.pyleft: Move tests/ci/test_* unit tests into ci/tests/ so they run in CI #109777 moved them intoci/testsso that they would run in CI, and they went with it.Result.from_pytest_runhas two call sites,ci/jobs/integration_test_job.pyandci/jobs/keeper_stress_job.py, both collecting undertests/.ci/jobs/check_style.pyrunsmypy,pylintandruff, no pytest.ci/testsdoes exist again with one file, carried in by the Label docker-daemon-death job truncation as infra for auto-retry #109673 merge, but nothing runs it. I am not treating that as a home: a test placed there cannot fail, so it would read as coverage while proving nothing.
The dropped file was master's own rather than something this PR added, so where ci/ tests live now looks like an upstream decision rather than one this PR can settle.
In place of a file nothing executes, here is the check itself. The 24 cases survive at 31da302e77c9f41 on this branch and all pass against the merged classifier at a15ffe94. Disabling the new branch reddens exactly the six that pin it: the four kill encodings 143, 137, -15, -9, plus the two bugfix-validation guards. So it is a live check, not a rubber stamp.
One residual I would rather name than gloss over: revert_ci_regressions.py holds "Test command killed by signal" as a literal, so a rename of KILLED_BY_SIGNAL_RESULT_NAME would silently drop it from SYNTHETIC_TEST_NAMES. That coupling was asserted by one of the dropped cases. Server died and Server liveness check failed are duplicated there the same way, so it is the existing pattern rather than something new here, but if you would rather have it closed by an import than by a test, say so and I will do that.
Otherwise, name a location with a live runner and I will restore the file there in one commit.
Related: #106183
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
A functional-test job synthesizes a
Server diedfailure whenever the test command diesfrom a signal, so an externally killed run reads as a crash nobody observed. On
PR #108676 /
Stateless tests (amd_tsan, parallel)the report readFailed: 0, Passed: 10564, Skipped: 171withServer diedas the only failure, while theartifacts show the server answering
system flush logsafter the kill and stopping cleanlyunder
--do-not-kill. As of 2026-08-21, 74 jobs across 41 PRs plus 3 master jobs carry this leaf alone in the preceding 30 days.Root cause:
ABORTED_RUN_EXIT_CODESmixesSTOP_TESTING_EXIT_CODE, where the parentobserved a reason to stop, with the kill-by-signal codes, which establish only that the
run was killed, never by whom, and labels both
Server died. So when the exit code isa kill-by-signal one and no failure was parsed, emit a
Test command killed by signalleaf instead.
STOP_TESTING_EXIT_CODEstays excluded; a parsed failure is unchanged.The leaf is
ERROR, the job result staysFAIL.ERRORon the leaf becauseinvert_bugfix_validation_statusflips anyFAILrow toOKwithout reading its name,turning an exit code into a claimed reproduction; its guard is per-row, and
reconcile_bugfix_crash_reprostill downgrades that row on aBLOCKERfatal, so a realcrash keeps validating (#105789).
FAILon the job result becauseis_errordisables coverage collection for the whole job.Validated by 8 new unit tests (11 cases, one parameterized over all four exit code
encodings), each load-bearing under mutation, taking the suite from 13 to 24 cases
with the existing ones unchanged. The three
job shapes carrying this signature were also driven against the pre-fix parser: job result, coverage
gate and
pipeline_statusall match. Notecheck_ci.can_processskipsERRORrows, so aCIDB sweep needs
test_status IN ('FAIL','ERROR').Workflow [PR]
Sync PR [sync-upstream/pr/112952]
Version info
26.10.1.786-master(included in26.10and later)