From 40117ea04b7b5ff5a41f4d5ad4159692eca93bdd Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sat, 7 Feb 2026 21:49:23 -0500 Subject: [PATCH 1/2] Use Object for ObjectSpace.dump test This test fails if BASE_SLOT_SIZE is 32 bytes because Strings occupy 40 bytes. Objects are smaller and would be 40 bytes. --- test/objspace/test_objspace.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 8b369c38945f4c..d631f97d1bcad8 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -703,8 +703,9 @@ def test_dump_escapes_method_name end def test_dump_includes_slot_size - str = "TEST" - dump = ObjectSpace.dump(str) + klass = Class.new + obj = klass.new + dump = ObjectSpace.dump(obj) assert_includes dump, "\"slot_size\":#{GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE]}" end From 0069009d35cf6b9ed78cf4fb5e5ce46dae21080f Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sat, 7 Feb 2026 22:24:27 -0500 Subject: [PATCH 2/2] Exclude test for MMTk --- test/.excludes-mmtk/TestObjSpace.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.excludes-mmtk/TestObjSpace.rb b/test/.excludes-mmtk/TestObjSpace.rb index 94eb2c436d4435..703efd79bb8c69 100644 --- a/test/.excludes-mmtk/TestObjSpace.rb +++ b/test/.excludes-mmtk/TestObjSpace.rb @@ -1,4 +1,5 @@ exclude(:test_dump_all_full, "testing behaviour specific to default GC") exclude(:test_dump_flag_age, "testing behaviour specific to default GC") exclude(:test_dump_flags, "testing behaviour specific to default GC") +exclude(:test_dump_includes_slot_size, "can be removed when BASE_SLOT_SIZE is 32 bytes") exclude(:test_dump_objects_dumps_page_slot_sizes, "testing behaviour specific to default GC")