Repository navigation
test: run the fake xcrun once before timing it - #67
Merged
Merged
Conversation
macOS vets a newly written executable on its first exec, which took up to 767ms here. TestReadLaunchdRetriesATimedOutRead gives each spawn 200ms, so the first, deliberately hanging attempt was often killed during that check before the script could remove its hang-once marker; the retry then hung too and the test failed (16 of 30 runs). newBatchFake now runs the fake once with its log sent to /dev/null, so short timeouts measure the fake.
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.
TestReadLaunchdRetriesATimedOutReadfailed intermittently withlaunchctl print-disabled: signal: killed: 16 of 30 runs on this Mac, onmainas well as on branches.Cause
macOS vets a newly written executable on its first exec. For the fake
xcrunthat took up to 767 ms here; later runs take about 9 ms. The test gives each spawn 200 ms, and its first attempt is the one meant to consume the hang-once marker and hang. That attempt was often killed during the macOS check, before the script ran, so the marker stayed. The retry then hung as well and the test failed. The retry logic inreadLaunchdwas fine.Fix
newBatchFakenow runs the fake once right after writing it, withFAKE_LOGset to/dev/nullso the call counts tests assert on are unchanged. Short timeouts then measure the fake instead of the first-exec check. The change is test-only.Results
TestReadLaunchdRetriesATimedOutReadTestLaunchdSpawnsDoNotHangOnAHeldPipemake checkpasses.