summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-05-31 14:01:11 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-05-31 14:03:30 -0400
commite8212c55f9a00ef5722ab8c6c093d418d581bcd2 (patch)
tree9d5e0b354b180fc1f9e602e175a1734f71745e2f /test
parent55c9c658bd6db1b317dc71de6edfefc96ca10a83 (diff)
Fix flaky test in test_objspace.rb
Ensure that the frozen string is promoted to the old generation by running the GC 4 times.
Diffstat (limited to 'test')
-rw-r--r--test/objspace/test_objspace.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 8c7e922b2e..4757c26630 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -281,6 +281,8 @@ class TestObjSpace < Test::Unit::TestCase
end
def test_dump_flags
+ # Ensure that the fstring is promoted to old generation
+ 4.times { GC.start }
info = ObjectSpace.dump("foo".freeze)
assert_match(/"wb_protected":true, "old":true/, info)
assert_match(/"fstring":true/, info)