janhoy opened a new pull request, #4478:
URL: https://github.com/apache/solr/pull/4478

   The BATS test suite was taking longer and longer, now about 40 mins on GH 
CI. This PR makes targeted, low-risk reductions without removing meaningful 
coverage.
   
   **Total estimated CI time saving: ~6 minutes**
   
   ## Changes
   
   ### Gate OpenNLP test behind `OPENNLP_TESTS=true` (~90 s saved)
   `test_opennlp.bats` downloads ONNX models from the network and its own 
comment describes it as exploratory rather than a regular CI test. It now skips 
unless `OPENNLP_TESTS=true` is set.
   
   ### `test_status.bats` — one shared Solr startup (~200 s saved)
   Four of six tests independently started and stopped their own Solr instance. 
Restructured with `setup_file`/`teardown_file` so all tests share a single 
startup (~3 Solr startups saved).
   
   CI timing showed "status with --short format" at 197 s — almost certainly 
caused by `solr stop` in teardown hanging when each test managed its own Solr 
lifecycle. The new structure uses a single
   `teardown_file` stop which eliminates this.
   
   ### `test_healthcheck.bats` — cheaper collection setup (~15 s saved)
   Both tests used `solr start -e films`, which loads and indexes the full 
films dataset. Replaced with `solr start` + `solr create -c healthcheck_test -d 
_default` for the cloud test, and plain `solr 
   start --user-managed` for the standalone test (which fails before any 
collection is needed).
   
   ### `test_packages.bats` → `PackageToolTest.java` (~25 s saved, delete BATS 
file)
   `PackageToolTest` already exercises the full package lifecycle 
(list-available, add-repo, install, deploy, undeploy). Added 
`testDeployValidationMessages()` to cover the two specific BATS assertions 
   not previously tested in JUnit: collection exists but package does not → 
correct error message; undeploy of never-deployed package → correct error 
message.
   
   ### `test_compression.bats` → `GzipCompressionTest.java` (~23 s saved, 
delete BATS file)
   The per-test times (154 ms, 72 ms, 77 ms) looked cheap, but the `setup_file` 
that ran `solr start -e films` cost ~22 s before any test ran. Added 
`GzipCompressionTest` to `solr/core`
   (`SolrCloudTestCase`) verifying Jetty's GzipHandler via the same Jetty 
`HttpClient` pattern used by `CacheHeaderTest` and `SecurityHeadersTest`. Sets 
`jetty.gzip.minGzipSize=1` as a system property
   before cluster start so that any non-empty response body is eligible for 
compression.
   
   ### `test_zk.bats` — remove/replace unnecessary `sleep` calls (~7 s saved)
   Removed six `sleep 1` calls that were redundant: `solr start` already waits 
until Solr is ready before returning, and `solr zk cp` is synchronous. Replaced 
one `sleep 1` after `solr zk upconfig` with 
   `wait_for` that polls the configsets REST endpoint instead of relying on a 
fixed delay.
   
   ## Testing
   ```bash
   # JUnit
   ./gradlew :solr:core:test --tests "*.PackageToolTest"
   ./gradlew :solr:core:test --tests "*.GzipCompressionTest"
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to