Skip to content

Commit ebc8a2e

Browse files
committed
Fix test_gets_separator_modified_by_io for MMTk
The test test_gets_separator_modified_by_io will intermittently fail on MMTk with: TestZlibGzipReader#test_gets_separator_modified_by_io [test/zlib/test_zlib.rb:1274]: Exception(RuntimeError) with message matches to "rs modified". RuntimeError expected but nothing was raised.
1 parent d0c85ee commit ebc8a2e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎test/zlib/test_zlib.rb‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,10 +1282,9 @@ def test_read0
12821282
end
12831283

12841284
def test_gets_separator_modified_by_io
1285-
# grown from an empty string so that the content lives in a separate
1286-
# buffer even with a GC that embeds 1000 bytes in the object (mmtk)
1287-
rs = "".dup
1288-
rs << "-" * 1000
1285+
# a shared substring stays outside the object even with a GC that embeds
1286+
# strings of any length (mmtk) and moves them to larger slots
1287+
rs = ("-" * 1000).freeze[0, 1000]
12891288
src = StringIO.new(Zlib.gzip(Random.new(0).bytes(200_000).tr("-", "x") + rs))
12901289
n = 0
12911290
io = Object.new

0 commit comments

Comments
 (0)