You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(java): suite is order-dependent — 21/21 in isolation, 15 failures in full-suite runs (global JAVA_HOME mutation / shared cache suspects) #258
The Java test family is order-dependent: results vary wildly between invocations of the same code.
EVIDENCE (all on v1.4.1 / main@6b2721a, same machine, minutes apart)
Full suite (pytest tests): 32 failed — all under tests/analysis/java/ (test_java_sitter.py x15, test_inheritance_call_graph.py x8, test_java_analysis.py x5, test_jcodeanalyzer.py x3).
Directory run (pytest tests/analysis/java): 11 failed.
pytest tests/analysis/java/test_java_sitter.py in isolation: 21/21 PASS — and these are tree-sitter tests with no JDK dependency at all, yet 15 of them fail inside the full suite.
Something earlier in the suite corrupts shared state.
PRIME SUSPECTS
JCodeanalyzer._get_codeanalyzer_exec mutates GLOBAL process state: os.environ["JAVA_HOME"] = str(java_home) (cldk/analysis/java/codeanalyzer/codeanalyzer.py ~line 116) — leaks across tests.
eager=True tests wiping/rebuilding the shared .codeanalyzer cache dir mid-suite while other fixtures hold paths into it.
cwd or tree-sitter language-registry pollution from the python/typescript test families that run first in pytest tests ordering.
FIX DIRECTION
Reproduce minimally with pytest -p no:randomly --lf-style bisection or pytest tests/analysis/python tests/analysis/java/test_java_sitter.py pair-wise to find the polluting family.
Remove the global env mutation (pass env to subprocess.run instead of os.environ); isolate cache dirs per test via tmp_path fixtures.
BLOCKS a meaningful CI-green (#255) — the release-gate flip cannot land while the suite's failure count depends on invocation shape. Sibling issues from the same investigation: #256 (deterministic source-code crash), #257 (TS fixture gating).
Retired as a standalone issue — consolidated into #255: the Java suite's order-dependence (global JAVA_HOME mutation / shared cache suspects; evidence preserved above) must be resolved as part of the same CI-green work.
Activity
rahlk commentedon Jul 14, 2026
Retired as a standalone issue — consolidated into #255: the Java suite's order-dependence (global JAVA_HOME mutation / shared cache suspects; evidence preserved above) must be resolved as part of the same CI-green work.