You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(test): the stop-signal tests signal the fake program before it records signals, so a signal in that gap is lost #1913
The stop-signal tests of devops ci test send their first signal before the fake program records signals. If the signal arrives in that gap, the program ignores it and records nothing, so the test fails with interrupted false. The failure depends on timing and shows up under load.
Evidence
tests/test_ci.py::test_a_second_signal_to_devops_ci_test_cannot_skip_the_sigkill[SIGTERM] failed in the remote Tests & Coverage check of pull request feat(tools): pin tuicr and ship its config template, ignore file and review round rules #1906 on 2026-10-22: assert (True, False, True, False) == (True, True, True, False). The second value, interrupted, is the wait for the record int in the signal log. The same test failed in a local gate earlier on 2026-10-22 and passed on the next run.
hung_script in tests/support/hung_children.py writes the pid file (echo "$$ $c" > "$0") before it runs after_start. For records_stop_signals, after_start installs the traps that record int and term. Until then the script runs under trap "" INT TERM, which ignores both signals.
watch.started is true as soon as the pid file exists. The test sends the first signal at once. A signal that arrives between the pid write and the trap installation is lost.
Remedy
Make the fake ready before the test signals it. For example, install the recording traps before the pid file is written, or write a ready marker after the traps and make the test wait for it. The test must still fail if the stop code skips the SIGKILL (show it with a mutation). Check the other users of hung_script with after_start for the same gap. No sleep or longer deadline is a fix.
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Type: type/bug. The candidate describes a defect in test behavior related to signal handling timing.
Priority: P2-Medium. The issue causes intermittent test failures under load, affecting test reliability but not core functionality. The failed run 1906 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 on the board.
Value: Medium. Fixing this improves test stability and reduces flakiness, benefiting developers working with the CI system.
Effort: Low. The fix involves reordering operations in the test setup to ensure proper signal recording before signaling.
Cause: hung_script wrote the pid file and only then ran after_start. For records_stop_signals, after_start set the traps that record int and term. A test signals the child as soon as it reads the pids. The child lost a signal that came between the pid write and the traps. The test then failed with interrupted false. The production code has no defect.
Change: hung_script has a new part, after_spawn. It runs after the grandchild starts and before the child writes the pids. records_stop_signals sets its traps there. The traps cannot go before the start of the grandchild, because the grandchild would then not ignore SIGTERM. The other users of hung_script set their traps in before or on_interrupt, or send no signal. They have no gap. The change touches no file in src/.
Existing tool considered: the fix needs no tool. It moves two trap commands in a shell script. The new test reads the mask of caught signals from /proc/<pid>/status, as the module already reads /proc/<pid>/stat. psutil is not a dependency, and its Process class (version 7.2.2) has no call for that mask. I estimate that the two test helpers cost about 30,000 tokens and 45 minutes. They need no upkeep, because the kernel interface is stable.
Tests: tests/test_support_hung_children.py makes the pid file a named pipe, so the child waits at the write of its pids. The test checks that the child already catches SIGINT and SIGTERM. It failed on the old order of the traps with `(Fa…
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate describes a defect in test behavior related to signal handling timing.The issue causes intermittent test failures under load, affecting test reliability but not core functionality.The failed run 1906 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 on the board.Fixing this improves test stability and reduces flakiness, benefiting developers working with the CI system.The fix involves reordering operations in the test setup to ensure proper signal recording before signaling.fix(test): the fake child sets its signal traps before it writes its …
dan-petty commentedon Oct 22, 2026
What changed
#1922, merged into
release/v0.2.39as 0fafb24.4 file(s) changed.
How it was verified
Check runs at 39a86c0:
Acceptance Criteria of
docs/agent/tasks/task-1913-stop-signal-tests-wait-until-the-fake-records-signals.md:records_stop_signalsand passes on the new order.records_stop_signalsfail when the stop code does not send the SIGKILL.tests/test_ci.pypassed 40 of 40 repeats under a stress pinned to one core.uv run devops ci test tests/test_support_hung_children.py tests/test_process.py tests/test_ci.pypasses.feat(release): v0.2.39 (#1947)