Repository navigation
#234: stop asserting how many GC runs the collection took - #249
Merged
Merged
Conversation
The test pinned gc_status()['runs'] at 4. That number says how often the GC coroutine got scheduled, not what the test is about, and under ASAN two full root buffers merge into one run: the ASAN job reported 3 with the same 80000 objects collected. Measured on the very body of this test: a delay every 10000 cycles gives four runs, one every 40000 gives one, and no delay at all gives one, while collected stays 80000 throughout. The test now asserts that deferred collection happened at all, which is what the counter was there to guard, and keeps the threshold and the collected count exact.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What was wrong
tests/gc/015-gc_threshold_stable_in_async.phptassertedruns: 4. That counter says how often the GC coroutine got scheduled during the run, which the code under test does not decide. OnLINUX_X64_DEBUG_ZTS_ASANtwo full root buffers merge into a single deferred collection and the test reports 3, with the same 80000 objects collected:Measured on the same body, without ASAN, by moving only the point where the GC coroutine gets a chance to run:
The collected count never moves; the run count moves by a factor of four.
What changed
The test now says that deferred collection happened at all, which is what that counter was added to guard — the comment in the test says as much. The threshold assertions and the exact collected count are untouched, so what the test proves about #234 is unchanged.
Verification
12 runs of the test and the whole
tests/gcgroup, 23 tests, 0 failed. Not reproduced without ASAN: 12 clean runs and 15 under 24 spinning load generators all gave 4.