Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix flaky BATS integration tests for extraction (#4303)

Jan Høydahl5aad2a757faa
diff --git a/solr/packaging/test/test_extraction.bats b/solr/packaging/test/test_extraction.bats
index 12c4b72840a..4b8e62ae59c 100644
--- a/solr/packaging/test/test_extraction.bats
+++ b/solr/packaging/test/test_extraction.bats
@@ -41,7 +41,13 @@ setup_file() {
if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then
export TIKA_PORT=$((SOLR_PORT+5))
docker run --rm -p ${TIKA_PORT}:9998 --name bats_tika -d apache/tika:3.2.3.0-full >/dev/null 2>&1 || true
- echo "Tika Server started on port ${TIKA_PORT}" >&3
+ echo "Waiting for Tika Server to be ready on port ${TIKA_PORT}" >&3
+ if ! wait_for 120 3 curl -s -f "http://localhost:${TIKA_PORT}/tika" -o /dev/null; then
+ export DOCKER_UNAVAILABLE=1
+ echo "WARNING: Tika Server did not become ready in time; Tika-dependent tests will be bypassed." >&3
+ else
+ echo "Tika Server is ready on port ${TIKA_PORT}" >&3
+ fi
else
export DOCKER_UNAVAILABLE=1
echo "WARNING: Docker not available (CLI missing or daemon not running); Tika-dependent tests will be bypassed." >&3
diff --git a/solr/packaging/test/test_start_solr.bats b/solr/packaging/test/test_start_solr.bats
index ef25ea32ee7..a24ceadd24c 100644
--- a/solr/packaging/test/test_start_solr.bats
+++ b/solr/packaging/test/test_start_solr.bats
@@ -80,7 +80,7 @@ teardown() {
solr assert --started http://localhost:${SOLR_PORT} --timeout 5000
run cat ${SOLR_LOGS_DIR}/solr-${SOLR_PORT}-console.log
- refute_output --partial 'Exception'
+ refute_output --partial 'Exception in thread'
}
@test "deprecated system properties converted to modern properties" {