Repository navigation
Do not let artifact-collection rows discard a bugfix-validation verdict - #114400
Conversation
A per-arch Bugfix Validation job could report FAIL, and so block the PR as unvalidated, on a run where the bug did reproduce. invert_bugfix_validation_status decides the verdict, then the COLLECT_LOGS stage appended ClickHouseProc.extra_tests_results with a bare extend_sub_results. That call re-derives the parent status from its children (Result._update_status), so a single FAIL artifact row overwrote the verdict. The gate in new_tests_check.py reads the job status with strict is_success, so any_bugfix_validation_passed then found no validating arch and refused the merge with "No per-arch Bugfix Validation job validated the bug". Those rows are produced inside prepare_logs, after the run is over, so they can never be part of the verdict. Seen on ClickHouse#113397: the PR's own bug hung DROP TABLE ... SYNC, the graceful stop timed out, the still-running server kept its status file locked and every clickhouse local system-table dump failed with CANNOT_OPEN_FILE. Both arches reported Failed: 1, Passed: 0 while their regression test row was OK. The more convincingly such a bug reproduces, the likelier the job discarded its own result. Attach those rows through attach_post_verdict_artifacts, which restores the captured status on a labelled bugfix-validation job. The rows stay visible in the report, they just stop voting. The captured status is restored rather than forced to OK so that every verdict the inverter can set survives: reproduction OK, no-repro SKIPPED, inconclusive ERROR. Scoping the restore to is_labeled_bugfix_validation, the same guard the inverter uses, leaves ordinary functional jobs reddening on a failed dump, which is real signal. Labelling the row LOG_CHECK or moving the append before the inverter was rejected: extra_tests_results is empty at that point, and a FAIL row reaching the inverter is flipped to OK and counted as a reproduction, so a broken log dump would become evidence that the bug was validated. A test records this. Only the ordering is fixed here. The graceful-stop timeout that left the lock held is a separate problem. Related: ClickHouse#113397
Internal second-model review (5 findings, all adjudicated, no blockers)Independent cold review of the resulting code plus a second-model pass, adjudicated before
Verified independently while reviewing, not taken on trust:
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20260811-224900 |
|
Workflow [PR], commit [c21d76e] Summary: ✅ AI ReviewSummaryThis PR fixes the bugfix-validation status flow in Missing context / blind spots
Final Verdict✅ No blocking findings. |
|
cc @leshikus @maxknv, could you review this? The bugfix-validation inverter sets the per-arch verdict, then the COLLECT_LOGS stage appended the system-table-dump rows with a bare extend_sub_results, which re-derives the parent status from its children, so one failed dump overwrote an OK verdict and new_tests_check blocked the PR as unvalidated. |
CI finish ledger - c21d76eEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
No test-level failure on this head: 176 check-runs, 0 queued or in progress, 32 success and 144 Gates: (a) 0 incomplete non-exempt checks; (b) Session id: cron:our-pr-ci-monitor:20260812-063000 |
2790ac4
`ci/tests/` is being removed, so this change stops adding to it. The review that approved ClickHouse#115825 reads, in full, "We don't use ci/tests, they will be removed.", and ClickHouse#115650 (+9/-24715) is open against that directory: its file list includes `ci/tests/test_unit_tests_bugfix_validation.py`, `ci/tests/test_new_tests_check_unit_gate.py` and `ci/jobs/ci_tests_job.py`, the runner that executes them. The first tranche, ClickHouse#114675 (+0/-6543), merged on 2026-08-15. The 15 arms added in the three earlier rounds of this change are therefore deleted rather than thinned or relocated: thinning still adds to a directory that is going away and still leaves a conflict to resolve. The earlier precedent for adding there, ClickHouse#114400, merged on 2026-08-13, before both that tranche and that review, so it does not license adding there now. What remains under `ci/tests/` is three stub signatures, and they are not arms kept by preference. `configure_before_binary` and `compile_before_binary` take a build type in this change, so without the adaptations 9 of that module's 97 existing cases raise `TypeError` and the live `CI Tests` job goes red on this PR. With them the module is 97/97 and the sibling gate module is 5/5. The correctness argument does not depend on the deleted arms. Fourteen mutants across the three earlier rounds each reddened only the case written for it and never a pre-existing one, and the last three were first run against all 109 pre-existing cases and survived, which is what established that each claim was genuinely uncovered rather than redundant. That record is evidence about this change, not shipped coverage. The module's own docstring already states that the build and run orchestration is validated separately in CI, so the file returns to exactly the coverage it had rather than below it; what is given up is a live regression guard for the escalation loop until ClickHouse#115650 lands. Separately, the module docstring claimed this job "builds the before binary in parallel with the build matrix (it starts as early as the functional/integration validators)". It does not: `ci/workflows/pull_request.py:139` is `JobConfigs.bugfix_validation_ut_job.set_run_after(CORE_BLOCKING_JOB_NAMES)`, the comment directly above it says the job is deferred behind the core blocking jobs, and that list includes every unit-test job. The clause was master's, but this change re-flowed the paragraph around it, so it is corrected here. The artifact-dependency half is true and stays: the job does not need the PR's `UNITTEST_AMD_ASAN_UBSAN` artifact, so it is not gated behind `build_amd_asan_ubsan`.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
@ nikitamikhaylov asked me to investigate why
Bugfix validationfails on #113397 andsuggest improvements (comment).
This fixes the harness defect I found while answering that. Related: #113397, @ tiandiwonder's
PR, which this one does not close.
There, both functional bugfix-validation jobs report FAIL even though the bug reproduced on
both arches: the regression-test row is
OK, and the only FAIL row isScraping system tables.An ordering defect.
invert_bugfix_validation_statusdecides the verdict, then theCOLLECT_LOGS stage appended artifact-collection rows with a bare
extend_sub_results, whichre-derives the parent status from its children (
praktika/result.py), so one failedsystem-table dump overwrote the verdict with
FAIL.new_tests_check.pyreads that statuswith strict
is_success, soany_bugfix_validation_passedfound no validating arch andblocked the PR with "No per-arch Bugfix Validation job validated the bug". Those rows come
from
prepare_logs, after the verdict, so they can never be part of it.The fix attaches them through a helper that restores the captured status on a labelled
bugfix-validation job. The rows stay visible in the report, they just stop voting.
Restoring the captured status rather than forcing
OKkeeps all three verdicts:reproduction
OK, no-reproSKIPPED, inconclusiveERROR. An ordinary job still reddens.The defect reproduces in-process, and six new cases in
ci/tests/test_bugfix_validation_inverter.pypin an ordering that had no coverage. Each waschecked against a mutated fix so its redness is attributable: dropping the restore fails
the three verdict cases, restoring the bare call fails the AST case, and applying the
restore unconditionally fails the ordinary-job control. One records why the rows must not
be labelled
LOG_CHECKinstead, which would count a broken dump as a reproduction.Only the ordering is fixed here. The dump itself failed because a graceful-stop timeout left
the server holding its status-file lock, which is separate.
Version info
26.8.1.1299(included in26.8and later)