summaryrefslogtreecommitdiff
path: root/test/ruby/test_string_memory.rb
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-08-03 13:33:03 +0900
committerYusuke Endoh <[email protected]>2024-08-03 14:39:17 +0900
commit42cd267beb55d0e40878a619a575264c5b138f97 (patch)
tree9c22c34e94663b32216fc361a814cfa40f28f9ab /test/ruby/test_string_memory.rb
parente5fb851fe77eca904dd23e71968d1317f6d8c0a3 (diff)
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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11306
Diffstat (limited to 'test/ruby/test_string_memory.rb')
-rw-r--r--test/ruby/test_string_memory.rb4
1 files changed, 4 insertions, 0 deletions
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