From 79b0b6ac989ee1d6fd7ed5c8144fe9d6d3adb878 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 28 Apr 2023 17:36:25 -0400 Subject: [PATCH] feat: use Nokogiri's HUGE parse option because some of these files get really big. --- lib/ruby_memcheck/test_task_reporter.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ruby_memcheck/test_task_reporter.rb b/lib/ruby_memcheck/test_task_reporter.rb index 3ee2192..a329a8c 100644 --- a/lib/ruby_memcheck/test_task_reporter.rb +++ b/lib/ruby_memcheck/test_task_reporter.rb @@ -31,7 +31,10 @@ def parse_valgrind_output(xml_files) @errors = [] xml_files.each do |file| - Nokogiri::XML::Reader(File.open(file)).each do |node| + reader = Nokogiri::XML::Reader(File.open(file)) do |config| + config.huge + end + reader.each do |node| next unless node.name == "error" && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT error_xml = Nokogiri::XML::Document.parse(node.outer_xml).root