Skip to content

Commit fe9f7cd

Browse files
committed
Remove flaky test.
1 parent 253c743 commit fe9f7cd

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

test/test_writer.rb

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -446,31 +446,6 @@ def test_nil_pe_issue
446446
assert_equal(writer.result, expected)
447447
end
448448

449-
def test_string_writer_does_not_leak_memory
450-
skip('RSS check not supported on Windows') if windows?
451-
452-
rss_by_round = []
453-
454-
4.times do
455-
5_000.times do
456-
writer = LibXML::XML::Writer.string
457-
document(writer, encoding: LibXML::XML::Encoding::UTF_8) do
458-
writer.write_element('test', 'hello')
459-
end
460-
writer.result
461-
end
462-
463-
GC.start(full_mark: true, immediate_sweep: true)
464-
465-
rss = rss_in_kb
466-
skip('RSS check not available') unless rss
467-
468-
rss_by_round << rss
469-
end
470-
471-
assert_operator(rss_by_round.last - rss_by_round[1], :<, 10_000)
472-
end
473-
474449
private
475450

476451
def document(writer, options = {})
@@ -491,10 +466,4 @@ def element(writer, localname)
491466
assert(writer.end_element)
492467
end
493468

494-
def rss_in_kb
495-
rss = `ps -o rss= -p #{Process.pid}`.strip
496-
Integer(rss)
497-
rescue Errno::ENOENT, Errno::EPERM, ArgumentError
498-
nil
499-
end
500469
end

0 commit comments

Comments
 (0)