Repository navigation
test: ExecServiceTests can no longer stall the suite - #133
Merged
Merged
Conversation
verifyNaturalExitCleanup launched a /bin/sleep with Process and, after several awaits, cleaned it up with waitUntilExit(). Cleanup can resume on another cooperative thread, where waitUntilExit never observes the exit (it waits on the launching thread's run loop), so the test hung forever whenever the thread changed. Sampled locally: ExecServiceTests.swift:56 in -[NSConcreteTask waitUntilExit], the sleep long gone. This is the stall CI hit on #128 and #130. Spawn it with posix_spawn and kill/waitpid it ourselves. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of the CI stalls on #128 and #130, which looked like a hang after DockStoreTests.
verifyNaturalExitCleanupstarted an unrelated/bin/sleepwithProcessand, after several awaits, cleaned it up in adeferwithwaitUntilExit(). The defer can resume on a different cooperative thread. TherewaitUntilExitnever observes the exit, because it waits on the launching thread's run loop. So the test hung whenever the thread changed.Caught locally with
sample: the main thread was inXCTWaiter, and a cooperative thread was in-[NSConcreteTask waitUntilExit]at ExecServiceTests.swift:56, with the sleep already gone.The fix spawns the sleep with
posix_spawnand kills and reaps it withkill/waitpid. The assertions are unchanged: same start time, still alive. Ran ExecServiceTests three times in a row: 19/19 each time.🤖 Generated with Claude Code