Repository navigation
test(optools): accept a KILL-escalated drain in the publication latch test - #33188
Conversation
… test TestEmbeddedPrebuiltPublicationCancellationLatch checks that every admitted process group is drained before cancellation is acknowledged. It also required the mock to stop on TERM (status 90), but the drain gives TERM a fixed 20-tick (5 s) grace and then sends KILL. On a loaded CI runner the grace ran out (subtest 8.24 s vs 0.55 s locally), the mock was killed before its trap ran, and the test failed although the drain completed. Require instead that the test process was started and is gone (status 91 already checks it is not alive). The graceful TERM path stays covered by the execution-cancellation test (MOCK_TERM / TERM_ACK). With a mock that ignores TERM (forcing the KILL escalation), the old test fails all three subtests with PUBLICATION_CANCELLED 90; the new one passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 0439f0c77e4489fb1ade49a8f8bf586a48535857
Assessment: approve
The revised assertion accepts either graceful termination or KILL escalation while still checking that the mock started and its PID is gone before cancellation is acknowledged. The existing execution-cancellation and process-group tests retain the distinct graceful-TERM and descendant-drain coverage. No actionable defects remain in the assigned change.
Model: gpt-6.1-terra / max
Session: 01a20eeb-75f7-7401-b423-95568690acce · slot 1 · generation 7
Validation:
-
Private /tmp and loopback preflight passed (preflight.log; checks/1795565722760640960-2.json).
-
The changed publication-latch test, graceful execution-cancellation test and process-group escalation test passed in normal mode (focused-normal-retry.log; checks/1795565793919810567-2.json).
-
The exact changed test passed a race measurement and 18 race-enabled repetitions, including each of the three publication boundaries (focused-race-measure.jsonl and focused-race-stress.jsonl; checks/1795565946917377469-2.json and checks/1795566022940136860-2.json).
-
With a test-only overlay making the mock ignore TERM, all three candidate subtests passed after KILL escalation. The merge-base test with the same mock failed all three with status 90, as expected. The only changed source file was overlaid for the base control (resistant-probe.log, base-resistant-probe.log, probe-inputs.sha256; checks/1795565909389776171-2.json, checks/1795565945221604481-2.json, checks/1795566058259468633-2.json and checks/1795566065236788457-2.json).
-
The frozen CI snapshot records successful Ubuntu unit and Coverage jobs (evidence.json:eligibility_snapshot.statusCheckRollup). The diff passed git diff --check and all three discussion keys were reconciled (diff-check.log, discussion-check.log; checks/1795566065236940048-2.json and checks/1795566065249076464-2.json).
Limitations:
-
The full optools package was not rerun locally; the assessment reuses the frozen CI results for broader coverage. The author reports a separate Python 3.15-specific package failure also present on main, which was not independently reproduced.
-
The first local test invocation stopped before compilation because GOTOOLCHAIN=local selected Go 1.26.6. The required Go 1.27.1 toolchain was obtained in the assigned cache and the reported checks were rerun successfully.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #33187
What this PR does / why we need it:
optools/TestEmbeddedPrebuiltPublicationCancellationLatch/test_pidsfailed the UT Coverage job of #33144 withPUBLICATION_CANCELLED 90(expected 143). That also blocked the coverage merge, so the PR got no coverage verdict. (run)Cause
The test checks the publication latch: every admitted process group is drained before cancellation is acknowledged. It also required the mock test process to stop on TERM, and write
stopped-execute-a(otherwise status 90).The drain (
terminate_ut_process_groups) gives TERM a fixed grace of 20 ticks (5 s), then sends KILL.Killed.Change
Test only; no runner script changes. The latch test now requires that the test process was started (its PID file exists) and is gone (the existing status-91 check), whether it stopped on TERM or was killed after the grace.
The graceful TERM path is still checked, deterministically, by the execution-cancellation test (
MOCK_TERM/TERM_ACK).I did not make the 20-tick child grace configurable. The parent's helper grace (
UT_HELPER_TERM_GRACE_TICKS, validated to 41–240) is sized against it, so changing it touches about 15 call sites and that rule.Testing
go test -count=3 -run 'TestEmbeddedPrebuiltPublicationCancellationLatch$' ./optools/passes.PUBLICATION_CANCELLED 90after about 5.8 s, the CI failure../optools/package: passes, exceptTestUTIncrementalActiveCases(test_invalid_deep_json_does_not_hide_later_failure). That one fails identically on unmodifiedmainlocally (Python 3.15) and is unrelated.🤖 Generated with Claude Code