OpenJDK Trivia: Increasing Max Output
OpenJDK tests keep the per-test output limit relatively small by default. This is usually a good tradeoff: successful tests do not need huge logs, and smaller limits reduce disk and I/O overhead.
But when a test crashes, that limit can hide the most useful part of the output. In those cases, temporarily raising the cap helps preserve more context.
§1. Do it on the command line
For a one-off run, pass a larger limit via JTREG:
1 | make test TEST=hotspot/gtest/GTestWrapper.java JTREG=MAX_OUTPUT=10000000 |
This is the simplest option when debugging a single failing test.
§2. Change it in TEST.ROOT
If you want the larger limit to come from the test configuration, add or update this entry in TEST.ROOT:
1 | maxOutputSize=12000000 |
For example, if you are working in the HotSpot test tree, edit:
1 | test/hotspot/jtreg/TEST.ROOT |
This is useful when you expect to rerun the same crashing test several times.
§3. Pass it through jib.sh
If you normally run tests through jib.sh, forward the same setting like this:
1 | bash make/jib.sh --test hotspot/gtest/GTestWrapper.java --test-make-args JTREG=MAX_OUTPUT=10000000 |
This is the same idea as the direct make test invocation, just routed through jib.sh.