diff --git a/changelog.d/7092-gc-test-copied-count.md b/changelog.d/7092-gc-test-copied-count.md new file mode 100644 index 0000000000..39ec2ec0d6 --- /dev/null +++ b/changelog.d/7092-gc-test-copied-count.md @@ -0,0 +1 @@ +**GC test de-flaked on macOS** — `large_object_old_born_array_slot_write_keeps_young_child_alive` asserted an exact whole-nursery `copied_objects == 1`, which fails on hosts whose startup allocations stay reachable through the dirtied old page (4249 observed on macOS arm64, #7060). The child-specific relocation is already pinned by the `rewritten` asserts, so the exact count is now a lower bound. Test-only change; no runtime behavior affected. diff --git a/crates/perry-runtime/src/gc/tests/copying.rs b/crates/perry-runtime/src/gc/tests/copying.rs index b6778abcc2..e4ada935d8 100644 --- a/crates/perry-runtime/src/gc/tests/copying.rs +++ b/crates/perry-runtime/src/gc/tests/copying.rs @@ -1310,7 +1310,13 @@ fn large_object_old_born_array_slot_write_keeps_young_child_alive() { assert_copied_minor_trace(&trace, true, CopiedMinorFallbackReason::None, false); assert_ne!(rewritten, child); assert!(crate::arena::pointer_in_nursery(rewritten)); - assert_eq!(trace.copying_nursery.copied_objects, 1); + assert!( + trace.copying_nursery.copied_objects >= 1, + "minor must copy at least the young child; copied_objects is a whole-process \ + count and host startup can leave other young objects reachable through the \ + dirtied old page (4249 observed on macOS arm64, #7060) — the child-specific \ + relocation is pinned by the `rewritten` asserts above" + ); assert!( remembered_set_size() > 0, "old-to-survivor edge must remain remembered after copied minor"