Repository navigation
Honour do_not_block_pipeline_on_failure for every non-ok job status - #114956
Conversation
A job that sets `do_not_block_pipeline_on_failure` still blocked its whole downstream closure whenever it ended `ERROR` rather than `FAIL`. The two consumers of the flag disagreed. `hook_html` gates on `not result.is_ok()`, so dependees were correctly not marked `DROPPED`, while `runner._post_run` gated on `result.is_failure()`, which covers `FAIL`/`XPASS` only, so an `ERROR` was never exempted and the job emitted `pipeline_status=failure`. Every dependent job's generated guard is `!contains(needs.*.outputs.pipeline_status, 'failure')` over a transitive `needs`, so that one token skips the entire closure. Both predicates were introduced together in b35b5fd and have been asymmetric since. The case that hits it: an integration shard exhausts its 7200s parallel-phase budget and appends a synthetic `Timeout` child while every real test passes. One non-ok child means `force_ok_exit = True`, so the job declares itself non-blocking, but the same timeout sets the error flag and `set_error()` makes the job-level status `ERROR`. That skipped 107 of 175 results on ClickHouse#107115 and 112 of 177 on ClickHouse#109071, including all five `Bugfix validation (*)` jobs. Because those never ran, the `new_tests_check` post-hook read them as `PENDING` and failed `Finish Workflow` reporting that the test is not actually a regression test for the fix, so a harness timeout in an unrelated shard became a verdict on the author's regression test. 8 occurrences across 8 PRs and 5 of the 6 shards in 30 days. The predicate is extracted into `Runner._pipeline_status` so a test can assert the production decision rather than a copy of it, following `_skip_missing_optional_artifact` in the same file. `functional_tests` passes the same flag after a path that can also end `ERROR`, so it is fixed by the same line. Merge-blocking is unchanged: `ready_for_merge` is computed from `job.allow_failure` alone and never reads this flag, and all six shards are `allow_failure=False`, so a failing shard still blocks the merge and still reports red. Only downstream dispatch changes. `new_tests_check` is left as it is, since its strict check is correct once the jobs actually run. Co-Authored-By: Claude Fable 5 <[email protected]>
The suite asserted `Runner._pipeline_status` directly and nothing else, so the seam the extraction created was untested: `_post_run` could stop calling the helper and re-derive the status inline, and every test stayed green. That is the regression this change exists to prevent, so it is now pinned at the call site. The merge-safety property was pinned only by configuration. Asserting `allow_failure is False` on the six shards is a fact about `job_configs`, not about the merge computation, so flipping that config would have silently removed the evidence for the claim that `ready_for_merge` never reads this flag. The invariant is now asserted where it lives. Driving `_finish_workflow` itself was rejected: it needs a live environment, S3, GH and workflow job data, so such a test would re-implement the harness and assert its own copy. Both use the `inspect.getsource` idiom already used elsewhere under `ci/tests`. Mutating the call site to re-derive the status inline, and the merge gate to read the flag, each redden exactly one of the two new tests and leave the other 44 green. That asymmetry is what shows the gaps were reachable rather than theoretical. Co-Authored-By: Claude Fable 5 <[email protected]>
The predicate that decides whether a non-blocking job skips its downstream closure is only observable through the line that writes the GH Actions output. The previous assertions pinned that the helper is called, so two mutations restored the production failure while leaving the suite green: emitting the literal "pipeline_status=failure" instead of the f-string, and overriding the variable after the helper call. Both are verified to redden now, and only that one test, while a benign refactor that merely prints the value stays green. Test-only change. ci/praktika/runner.py, native_jobs.py and hook_html.py are byte-identical to the previous commit.
Internal second-model reviewThree rounds: an independent cold read of the resulting code plus a second-model gate pass each
💡 A behavioural test of the report-side dependee drop, and of the emitted output, instead of the 💡 The added docstring lines outnumber the added code lines - disagreed. Three of them replace 💡 A widening path outside the changed lines - checked and found contained, so not raised as a No blocker was raised against the production change. |
Pre-PR validation gate (click to expand)
Full Session id: cron:clickhouse-impl-slot-4:20260815-142100 |
|
Workflow [PR], commit [6ab8867] Summary: ✅ AI ReviewSummaryThis PR makes Final Verdict✅ No findings. |
|
cc @leshikus @maxknv, could you review this? A job that sets |
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, 5 s compile time in total, 6 of them have a recent master baseline. |
CI finish ledger - 6ab8867CI is fully finished on this head and it is clean: 177 check-runs, 7 success / 170 skipped,
Those two CIDB rows are historical, not open. Both predate the label being applied; the same The 45 tests added in Session id: cron:our-pr-ci-monitor:20260816-003000 |
b9db646
Related: #107115
Related: #109071
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
A job that sets
do_not_block_pipeline_on_failurestill blocked its whole downstream closurewhenever it ended
ERRORrather thanFAIL.The two consumers disagreed.
hook_html.py:224gates onnot result.is_ok(), sodependees were correctly not marked
DROPPED.runner.py:910gated onresult.is_failure(),which is
FAIL/XPASSonly, so anERRORwas never exempted and the job emittedpipeline_status=failure. Every dependent job's guard is!contains(needs.*.outputs.pipeline_status, 'failure')over a transitiveneeds, so that onetoken skips the entire closure.
The case that hits it: an integration shard exhausts its 7200 s parallel-phase budget and appends
a synthetic
Timeoutchild while every real test passes. One non-ok child meansforce_ok_exit = True, so the job declares itself non-blocking, but the same timeout sets theerror flag and
set_error()makes the statusERROR. That skipped 107 of 175 results on #107115and 112 of 177 on #109071, including all five
Bugfix validation (*)jobs. Because those neverran,
new_tests_check.pyread them asPENDINGand failedFinish Workflowwith "it's notactually a regression test for the fix", reporting a timeout in an unrelated shard as a verdict on
the author's regression test. 8 occurrences across 8 PRs and 5 of the 6 shards in 30 days.
runner.pynow uses the same predicate ashook_html, extracted so it is reachable from a test.They have been asymmetric since the
runner.pyconsumer was added inb35b5fd41f28412.functional_tests.py:1527passes the same flag after a path that can also endERROR, so it isfixed by the same line.
Merge-blocking is unchanged.
ready_for_mergeis computed fromjob.allow_failurealone(
native_jobs.py:1102-1117) and never reads this flag; all six shards areallow_failure=False,so a failing shard still blocks the merge and still reports red. Only downstream dispatch changes.
new_tests_check.pyis left as it is: its strict check is correct once the jobs actually run.Validation
Every mutation below was applied to production code and the suite re-run.
is_failure()(pre-fix behaviour)flag=Falserow)hook_htmlpredicate drifted tois_failure()Arm B is what rules out a vacuous oracle: a test that ignored the flag would stay green. Arms D,
E and F each redden exactly one test, pinning the seams nothing else covers: the call site the
extraction created, the token actually emitted, and the merge computation the paragraph above
rests on.
The new test parametrizes every non-ok member of
Result.Status(FAIL,ERROR,XPASS,DROPPED,UNKNOWN,PENDING,RUNNING) and all three ok members against flag on/off, assertsthe two consumers reach the same verdict, reproduces the measured production shape (903
OK+17
SKIPPED+ 1Timeout), and pinsallow_failure=Falseon the six shards.Full
ci/tests: 972 passed / 31 skipped / 8 failed with the fix, versus 927 / 31 / 8 on pristinerunner.py. The same 8 pre-existing environment failures on both arms (clickhouse was not found in PATH); the delta is the new tests.Exactly two production
complete_job(call sites pass this flag, and both are covered by thisone line. The only other writer of
pipeline_statusis the config job's unconditionalsuccess. The remainingis_failure()uses are test-level row filtering or rendering, notjob-level gating.
Version info
26.8.1.1812(included in26.8and later)