SOLR-18642 Replace BATS with CATS #5323
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 402 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5323"
general
weight: 0.35
janhoy
https://issues.apache.org/jira/browse/SOLR-18642
The JIRA covers what CATS is. This is how it is built and how to review it.
<img width="980" height="500" alt="cats-overview" src="https://github.com/user-attachments/assets/8bc4133d-94a0-411c-bf36-13cdae88f641" />
Layout
| | |
| --- | --- |
|
solr/test-framework/src/java/org/apache/solr/shell/| the harness: 20 files, ~4.3k lines ||
solr/packaging/src/test/org/apache/solr/shell/| 30 suites, ~4.4k lines, replacing the 29.batsfiles ||
solr/packaging/build.gradle,.github/workflows/cats-test.yml| thecatsTeststasks, and a bash + cmd.exe CI matrix |SolrShellTestCaseis the base class,session/CliSessionruns commands and owns the rails,env/resolves directories and ports.How it works
SOLR_HOME,SOLR_PID_DIR, logs directory and four ports (stop atP-1000, ZooKeeper atP+1000), claimed from a counter file under aFileChannel.lock()and kept below every platform's ephemeral port floor.solr.process.scan.markersysprop thatSolrProcessManagerfilters on, which behaves identically on both platforms and survives aSOLR_HOMEwipe.${NAME}before any shell sees it (bash expands$NAME, cmd.exe wants%NAME%), failing on an unknown name instead of substituting empty. Non-portable constructs — shell operators,$(, backticks,/dev/null, ~45 Unix-only tools — fail at the call site naming the fluent method that replaces them;@EnabledOnShelllifts the rails per test.run()asserts success,runFail()a non-zero status,tryRun()nothing; making success the default found 13 sites that had been ignoring a non-zero exit.curl,jq,opensslanddockerbecame Java and Testcontainers, so no test needs an external tool or the network.FAILED:line, aSOLR_HOMEsnapshot, and pre/post-flight port checks that pin a leak on the class that caused it.Running and reviewing
catsTestsPicocli/catsTestsCommonsClipin the CLI implementation,-Pcats.tests.jvms=Nsets the fork count, and the same commands run under cmd.exe. Output and per-testtranscript.logland undersolr/packaging/build/cats-test-output/.Reading order:
CliSessionandSolrShellTestCase, thenHarnessEnv/PortBlocksfor the isolation model, thenZkTest.javabesidetest_zk.bats. The BATS suites still pass, so the two can be compared directly.🤖 Developed almost entirely by Claude Code. I have not yet reviewed all of it myself.