Repository navigation
Keep the zombie-cap test's outcomes off the scheduler - #213
Merged
Merged
Conversation
an_observed_exit_is_gone_once_the_zombie_shows_within_the_cap gave
liveness_after_exit_with a 5 ms wall-clock cap in every case. Two of
its assertions then depended on how long the 200 us sleeps between reads
took:
- The in-time case needs a third read before the cap. When a sleep ran
past the cap, the loop correctly returned Unknown("exiting") after the
second read, and the test expected Gone.
- The still-exiting case asserted a second read. One long sleep after the
first read used the whole cap.
The in-time case is about stopping at the zombie, so it now has an ample
cap and still asserts exactly three reads. The still-exiting case keeps
the short cap and drops the read count; the in-time case already shows
that the loop reads again. liveness_after_exit_with is unchanged.
Contributor
Author
|
Independent read GO at exact head Read:
Risks (low): the still-exiting case no longer asserts how many times it re-read. A failure of the in-time case would now take up to its 10 s cap to report. |
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.
This fixes a timing flake in
operation::record::tests::an_observed_exit_is_gone_once_the_zombie_shows_within_the_cap. I found it while measuring the keyed flake for #212: it failed 1 of 60 whole pty-core lib runs at main, pinned to one core with two spinners.Cause. The test gave
liveness_after_exit_witha 5 ms wall-clock cap in every case. The loop reads the table, returns if it showsGoneor the cap has passed, and otherwise sleeps 200 µs. Two assertions therefore depended on how long those sleeps took:Unknown("exiting")after the second read, and the test expectedGone.Fix. Test only;
liveness_after_exit_withis unchanged.Unknown("exiting")and waited-out-the-cap assertions, and drops the read count. The in-time case already shows that the loop reads again.Measured on Linux, at main 85b6ce5. Each run executes the test alone, 8 loops at once on one core with two spinners, 1200 runs per side. Main and this branch ran side by side:
The first pair's branch binary had only the ample cap, and the
:986assertion didn't fail in its 1200 runs. The second pair is the final change. Without contention, main failed 0/1000 and 0/1000 with the test alone, unloaded and on a loaded core. pty-core lib on this branch: 205 passed.