Skip to content

test: synchronize interrupt tests on observable state, not fixed sleeps#62385

Merged
adienes merged 2 commits into
JuliaLang:masterfrom
IanButterworth:ib/interrupt-test-sync
Jul 15, 2026
Merged

test: synchronize interrupt tests on observable state, not fixed sleeps#62385
adienes merged 2 commits into
JuliaLang:masterfrom
IanButterworth:ib/interrupt-test-sync

Conversation

@IanButterworth

Copy link
Copy Markdown
Member

Followup to fix flaky tests from #62069

Re. #62069 (comment)

Addresses post-merge review of the interrupt tests added in JuliaLang#62069: the
"SIGINT at idle REPL prompt", "SIGINT during REPL evaluation of a sleep
loop", and "Distributed.interrupt reaches a busy worker" testsets used
fixed `sleep`s to guess when the target process was ready to receive the
signal, which is unsound on loaded CI machines and was failing there
(https://buildkite.com/julialang/julia-pr/builds/362#_).

Apply the same approach as the fix for the fourth testset in JuliaLang#62298:
synchronize on output round-trips through user code before signaling,
and make the post-signal assertions independent of timing by retrying
the aliveness round-trip (SIGINT aborts an in-flight REPL input line)
and synchronizing on the sleep loop's own output. For the Distributed
test, delivery on the worker is timing-sensitive (the InterruptException
lands in whichever task last parked in the scheduler, which may be the
message loop, killing the worker), so retry with a fresh worker up to
three times; a swallowed interrupt is a hard failure regardless. Capture
the subprocess output and report it when the test fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IanButterworth IanButterworth requested a review from vtjnash July 14, 2026 19:04
@IanButterworth IanButterworth added merge me PR is reviewed. Merge when all tests are passing and removed merge me PR is reviewed. Merge when all tests are passing labels Jul 14, 2026
On a loaded machine a single SIGINT delivered right after the loop
starts can be missed, so the InterruptException never surfaces and the
REPL stays busy in the loop. Resend the signal until the exception is
observed.

Fixes CI failure on macOS x86:
JuliaLang#62069 test/misc.jl SIGINT during
REPL evaluation of a sleep loop

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IanButterworth IanButterworth added the merge me PR is reviewed. Merge when all tests are passing label Jul 15, 2026
@adienes adienes merged commit d4f184f into JuliaLang:master Jul 15, 2026
10 checks passed
@IanButterworth IanButterworth deleted the ib/interrupt-test-sync branch July 15, 2026 14:47
@IanButterworth

Copy link
Copy Markdown
Member Author

I don't think this test is fully de-flaked yet. Our macOS x86 test workers are heavily oversubscribed and very old. I'm looking into balancing it better.

Screenshot 2026-07-15 at 9 53 45 AM

@IanButterworth

Copy link
Copy Markdown
Member Author

I think the issue was JuliaLowering_stdlibs running in parallel #62392

@adienes adienes removed the merge me PR is reviewed. Merge when all tests are passing label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants