From b85a4e562b22c942b88344ab6438cc5b88f47d0f Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 21 Aug 2026 16:21:34 +0200 Subject: [PATCH] ci: the watcher must not fail a run the ratchet passed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I added a watcher to this lane to find out what it was running out of. It found five memory blowups. It also, twice, turned a successful run into a red one: passing examples: 15005 (files loaded: 2135, failed to load: 71) frozen floor: 14900 note: 105 more passing than the floor ruby/spec ratchet OK Terminated ##[error]Process completed with exit code 1 The ratchet passed and the step failed, in tearing the watcher down. An EXIT trap did that, and the status the step ended with was whatever the trap left behind. The status is taken from the ratchet before anything is killed, and handed back explicitly. The race is not reproducible on demand, which is a reason to remove the mechanism rather than to keep timing it. Checked both ways: a ratchet exiting 0 gives a step exiting 0, and a ratchet exiting 1 still gives a step exiting 1 — the guard must not swallow a real failure to avoid a false one. --- .github/workflows/rubyspec-ratchet.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rubyspec-ratchet.yml b/.github/workflows/rubyspec-ratchet.yml index 720b0e6c..54427591 100644 --- a/.github/workflows/rubyspec-ratchet.yml +++ b/.github/workflows/rubyspec-ratchet.yml @@ -71,8 +71,24 @@ jobs: sleep 30 done ) & watcher=$! - # The child sleep outlives a kill of the subshell alone, and the runner - # would then report an orphan it had to terminate — noise in the very - # log this exists to make readable. - trap 'pkill -P "$watcher" 2>/dev/null; kill "$watcher" 2>/dev/null; true' EXIT + # Take the ratchet's own status and exit with it, rather than leaving + # the step's status to whatever tearing down the watcher leaves behind. + # + # An EXIT trap did the tearing down at first, and twice reported a run + # that had printed "ruby/spec ratchet OK" as a failure — "Terminated", + # then exit 1. The race is not reproducible on demand, which is reason + # to remove the mechanism rather than to keep timing it: the status is + # captured before anything is killed, and handed back explicitly. + # + # The child sleep outlives a kill of the subshell alone, so it is + # killed first and waited for — otherwise the runner reports an orphan + # it had to terminate, which is noise in the very log this exists to + # make readable. + set +e scripts/conformance/rubyspec/run.sh + status=$? + set -e + pkill -P "$watcher" 2>/dev/null || true + kill "$watcher" 2>/dev/null || true + wait "$watcher" 2>/dev/null || true + exit "$status"