Repository navigation
fix(net): make the listener GC rewrite test deterministic - #8712
Merged
Merged
Conversation
Lands #8711. `gc_mutable_scanner_rewrites_listener_roots` could only observe a rewrite when the collector actually moved the root, and a unit-test heap is normally too quiet for the evacuation policy to choose the copying path -- so the test could pass having exercised nothing. This is a strengthening, not a relaxation. It forces evacuation under the existing GC_TEST_LOCK (restoring any runner-supplied value on Drop), adds an ordinary shadow-stack root as a CONTROL whose rewrite proves the cycle copied live objects independently of scan_net_roots, and asserts the subject actually ran: copying_minor_cycles() > before -- "minor GC did not run the copying collector, so the scanner was not exercised" moved_objects_total() > before -- "copying minor did not relocate an object, so the scanner was not exercised" That is the #7024/#7025 lesson applied: a gate must assert its subject was live, not merely that nothing threw. All four tests in the crate take GC_TEST_LOCK, so the process-global env mutation is serialized. Carries skip-changelog. No version bump.
9 tasks done
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesGC test evacuation coverage
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Lands #8711.
gc_mutable_scanner_rewrites_listener_rootscould only observe a rewrite when the collector actually moved the root — and a unit-test heap is normally too quiet for the evacuation policy to pick the copying path. So the test could pass having exercised nothing.This is a strengthening, not a relaxation — worth saying plainly, because "make the test deterministic" is a phrase that usually means the opposite. It:
GC_TEST_LOCK, restoring any runner-suppliedPERRY_GC_FORCE_EVACUATEonDrop;scan_net_roots— so a listener left at its old address is now an actual scanner failure rather than an ambiguous result;That is exactly the #7024/#7025 lesson — a gate must assert its subject was live, not merely that nothing threw.
I checked the one thing that could bite:
std::env::set_varis process-global, but all four tests inperry-ext-nettakeGC_TEST_LOCK, and each crate's tests run in their own process, so the mutation is properly serialized.Validation
lint-job checkers passperry-ext-net(RUST_TEST_THREADS=1): 28 passed, 0 failedCarries
skip-changelog. No version bump.Summary by CodeRabbit