From 42cd267beb55d0e40878a619a575264c5b138f97 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sat, 3 Aug 2024 13:33:03 +0900 Subject: Reduce noise in object generation count tests The parallel testing framework may create strings in a separate thread. ``` 1) Failure: TestStringMemory#test_byteslice_prefix [D:/a/ruby/ruby/src/test/ruby/test_string_memory.rb:40]: One object allocation is expected, but allocated: [["D:/a/ruby/ruby/src/tool/lib/test/unit/parallel.rb", 42, String, "2240\x00\x00\x00\x00... ``` https://github.com/ruby/ruby/actions/runs/10222885396/job/28288271190?pr=11271#step:23:1026 --- test/ruby/test_string_memory.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby/test_string_memory.rb') diff --git a/test/ruby/test_string_memory.rb b/test/ruby/test_string_memory.rb index 249aa3a269..e264dd5705 100644 --- a/test/ruby/test_string_memory.rb +++ b/test/ruby/test_string_memory.rb @@ -25,6 +25,10 @@ class TestStringMemory < Test::Unit::TestCase instance.class, instance, ] + end.select do |path,| + # drop strings not created in this file + # (the parallel testing framework may create strings in a separate thread) + path == __FILE__ end ensure GC.enable -- cgit v1.2.3