Skip to content

Commit

Permalink
test: small improvements to memory leak test suite
Browse files Browse the repository at this point in the history
Related to #1603
  • Loading branch information
flavorjones committed Oct 15, 2022
1 parent 8582b0a commit 8dacf06
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_memory_leak.rb
Expand Up @@ -92,8 +92,11 @@ def test_for_memory_leak
def test_node_set_namespace_mem_leak
xml = Nokogiri::XML("<foo></foo>")
ctx = Nokogiri::XML::XPathContext.new(xml)
loop do
ctx.evaluate("//namespace::*")
20.times do
10_000.times do
ctx.evaluate("//namespace::*")
end
puts MemInfo.rss
end
end

Expand Down Expand Up @@ -161,7 +164,7 @@ def test_leak_on_xpath_string_function
end
end

def test_leaking_namespace_node_strings
def test_leaking_namespace_node_strings_no_prefix
# see https://github.com/sparklemotion/nokogiri/issues/1810 for memory leak report
ns = { "xmlns" => "http://schemas.xmlsoap.org/soap/envelope/" }
20.times do
Expand Down

0 comments on commit 8dacf06

Please sign in to comment.