Repository navigation
tests: Mainframe Ground Truth's evidence, galaxy IR and javac-driven tests 2-4x faster - #5914
Merged
Merged
Conversation
…inframe Ground Truth) The two were 225 + 236 of Mainframe Ground Truth's 2,983 test-seconds (run 39658216459). - test_evidence_components (61 s -> 18 s here): test_the_components_partition_each_input (112 s on a runner) re-read every file from disk and recomputed all five inputs for each of ~1,000 single-file edits, to compare one. The test now reads each file once (_read) and asks evidence.spec_inputs for the input it checks (`names=`, new); evidence.py memoises _java_code and answers _names from the port text's word set (a stem of word characters is named exactly when it is one of the text's \w+ runs; any other stem keeps the regex). compute_inputs is identical to before for all 52 targets. - test_galaxy_ir (51 s -> 13 s here): its 32 galaxyscope scans of 2-3 file fixtures each paid ~1.3 s (~3.5 s on a runner) of importing the engine for ~0.2 s of scanning. tests/tools/scan_server.py is galaxy_ir.scan_to_db with the engine imported once a process: a single-threaded server forks a child per scan that runs the module as `python -m gitgalaxy.galaxyscope` does (runpy, the caller's env and cwd), every child from the same just-imported state. Master DB identical to the engine's own scan, every table and row (tested). No fork, GITGALAXY_SCAN_SERVER=0, or a failed server: galaxy_ir.scan_to_db itself. The test file rebinds scan_to_db; no test body changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…und Truth) The javac launcher calls (absolute path, as test_java_subprocess_utf8 identifies them) in 38 files of tests/cobol_mainframe -- 54 calls -- go through javac_server.javac, imported as javac_run; only the callee changes, the argv and keywords are as they were. Those files, here: 93 s -> 50 s (1,710 passed, 452 skipped, both ways). - test_java_subprocess_utf8: a javac_run(...) call is a javac launch (the -encoding UTF-8 check covers it as it covered the subprocess.run). - javac_server: the launcher's links are resolved before its JDK is chosen. /usr/bin/javac and /usr/bin/java can be two JDKs (17 and 21 here): test_td_forge_5168's /usr/bin/javac got JDK 21's compiler, rc 2. A bare `javac` (PATH's) is the launcher's, not served. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
enabled auto-merge (squash)
October 21, 2026 21:30
Owner
Author
|
No description provided. |
This was referenced Oct 22, 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 about 17% of the saturated CI pool's runner time. This PR speeds up three of its slow areas. The CI shares below come from run 39658216459's per-test times, 2,983 test-seconds in all.
test_evidence_components.pytest_galaxy_ir.pytests/tools/scan_server.py: the engine imported once a processjavactests/tools/javac_server.py(#5901)1.
test_evidence_components.pytest_the_components_partition_each_input(112 s on a runner) makes about 1,000 single-file edits. For each one it re-read every file from disk and recomputed all five inputs, only to compare one._read) and asks for only the input it checks, through the newnames=argument toevidence.spec_inputs.evidence.py:_java_codeis memoised._namesanswers from the port text's word set: a stem made of word characters is named exactly when it is one of the text's\w+runs, and any other stem keeps the regex.compute_inputsis byte-identical tomain's for all 52 evidence targets.2.
test_galaxy_ir.pyIts 32 galaxyscope scans of 2–3-file fixtures each spent about 1.3 s (about 3.5 s on a runner) importing the engine, for about 0.2 s of actual scanning.
tests/tools/scan_server.pyprovidesgalaxy_ir.scan_to_dbwith the same signature, but the engine is imported once per process:python -m gitgalaxy.galaxyscopedoes (runpy, with the caller's environment and working directory).fork(Windows),GITGALAXY_SCAN_SERVER=0, or a failed server all go togalaxy_ir.scan_to_dbitself.scan_to_db.4. The
javac-driven testsjavaclauncher calls in 38 files oftests/cobol_mainframenow go throughjavac_server.javac, imported asjavac_run. Only the callee changed; argv and keywords are as they were.test_java_subprocess_utf8.py) treatsjavac_run(...)as ajavaclaunch, so the-encoding UTF-8check still covers those calls.javac_server:/usr/bin/javacand/usr/bin/javacan be two different JDKs (17 and 21 on the box where this was found), sotest_td_forge_5168's/usr/bin/javachad been compiled by JDK 21. A regression test covers it.javacfrom PATH is left to the launcher.Checks
tests/toolspass (511 skipped).tests/tools/test_scan_server.pyand additions totests/tools/test_javac_server.py.tests/ruff_audit.py --ci: no new findings.🤖 Generated with Claude Code