Repository navigation
tests: a javac that stays up for the det programs' tests (Mainframe Ground Truth -18%) - #5901
Merged
Merged
Conversation
…round Truth) test_det_nondigit_zoned.py was 22% of Mainframe Ground Truth's test time (649 of 2983 test-seconds on run 39658216459): 496 tests, each a javac of a small program (~0.6 s here, ~1.7 s on a runner -- a JVM start, then a ~0.05 s compile). Its _det helper (test_det_nondigit_binary.py) now compiles through tests/tools/javac_server.py: the JDK's own compiler (javax.tools) in one JVM per process, answering as subprocess.run of the launcher does (return code, diagnostics on stderr, check, timeout). Class files byte-identical to the launcher's. Anything it cannot answer the same goes to the launcher: no -encoding, a relative path, its own cwd / env / streams, -J options, @argfiles, -version and the like, a server that died twice. GITGALAXY_JAVAC_SERVER=0: always the launcher. The programs still run in a java of their own. The two files, locally: 264 s -> 42 s (460 passed, 41 skipped, both ways). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 21, 2026
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.
Mainframe Ground Truth is 17% of the CI pool's runner time (2026-10-21: ~3,800 of ~22,100 runner-min), and the pool is saturated (p90 job queue 25-31 min, 14-17 UTC).
Where its time goes
On run 39658216459, pytest is about 6.6 of each part's 8 min; setup is about 1 min.
tests/cobol_mainframe/test_det_nondigit_zoned.pyalone is 649 of 2,983 test-seconds (22%): 496 tests, each running ajavacon a small translated program. A local measurement:javac: 0.58 s (a JVM start; the compile itself is about 0.05 s warm)java: 0.06 sOn a runner that's about 1.7 s a test.
Change
tests/tools/javac_server.py: the JDK's own compiler (javax.tools, what thejavaclauncher runs) in one JVM per process.javac(argv, **kw)answers assubprocess.run(argv, **kw)does for the launcher: the return code, diagnostics on stderr (printed unless captured),check, andtimeout.-encoding(the launcher reads sources in the locale's charset), a relative path, its owncwd/env/streams,-Joptions,@argfiles,-versionand the like, or a server that died twice.GITGALAXY_JAVAC_SERVER=0forces the launcher.javaprocess of their own.test_det_nondigit_binary._det, whichtest_det_nondigit_zoned.pyuses, compiles through it.Measured (local)
test_det_nondigit_zoned.py+test_det_nondigit_binary.py: 264 s → 42 s (6.3×), 460 passed and 41 skipped both ways. Scaled to CI, that's about 550 of 2,983 test-seconds a run (about 18%), roughly 1.2 min off each part of a 2-part run.Next (not here)
About 40 other test files call
javacdirectly (about 394 test-seconds on CI, 13% more). They can switch tojavac_server.javacone call site at a time.Checks
tests/toolsand the UTF-8 subprocess guard (test_java_subprocess_utf8.py): pass. The server's ownjavacarries the UTF-8 flags, and only requests that state-encodingare served.tests/tools/test_javac_server.py: byte-identical classes, identical diagnostics and return code on a compile error, every launcher fallback, and a dead server replaced.tests/ruff_audit.py --ci: no new findings.🤖 Generated with Claude Code