[FIX] Optimize JUnit processing time for large test results - #81
Open
johnwonkim wants to merge 1 commit into
Open
[FIX] Optimize JUnit processing time for large test results#81johnwonkim wants to merge 1 commit into
johnwonkim wants to merge 1 commit into
Conversation
johnwonkim
force-pushed
the
codex/fix-junit-processing-runtime
branch
from
July 28, 2026 21:41
8a8a161 to
0d71b04
Compare
johnwonkim
marked this pull request as ready for review
July 28, 2026 21:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testcaseelements with a directfailureorerrorchild.failure | errortraversal so failure/error ordering and formatting behavior remain unchanged.Unreleased.Root cause
The JUnit parser currently evaluates
//testcase, then inspects every matched testcase for failure or error children. REXML restores XPath matches to document order by constructing ancestor/sibling index paths, andREXML::Parent#indexlinearly scans siblings. For a wide suite withNsibling testcases, sorting all testcase matches therefore approaches O(N²), even when nearly every testcase passes.The updated XPath is evaluated inside REXML:
REXML still parses and traverses the complete XML document, but passing testcases do not enter its expensive final result-ordering step. The existing inner
failure | errortraversal is unchanged.Selecting
//failure | //errordirectly would not be equivalent: it could include elements outside testcases and can change REXML's union ordering.Compatibility
The regression specs cover:
failureanderrorelementsREXML::Parent#indexcallsValidation
bundle exec rspec: 107 examples, 0 failuresbundle exec rubocop: 25 files inspected, no offenses detected