From c3cc7ae15c47c75e36bec757d981cf47fdb8a990 Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Thu, 28 Oct 2021 15:05:17 +0200 Subject: [PATCH] ci: Check for readiness of Logstash in Logspout test Since we restart Logstash to enable the UDP input prior to running this test, we should also ensure it has successfully come back, otherwise we start searching for the expected documents in Elasticsearch way too early and often run into timeouts. --- .github/workflows/scripts/run-tests-logspout.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/run-tests-logspout.sh b/.github/workflows/scripts/run-tests-logspout.sh index ca2d327..cebd4d8 100755 --- a/.github/workflows/scripts/run-tests-logspout.sh +++ b/.github/workflows/scripts/run-tests-logspout.sh @@ -8,16 +8,21 @@ source "$(dirname ${BASH_SOURCE[0]})/lib/testing.sh" cid_es="$(container_id elasticsearch)" -cid_ls="$(container_id logspout)" +cid_ls="$(container_id logstash)" +cid_lsp="$(container_id logspout)" ip_es="$(service_ip elasticsearch)" -ip_ls="$(service_ip logspout)" +ip_ls="$(service_ip logstash)" +ip_lsp="$(service_ip logspout)" log 'Waiting for readiness of Elasticsearch' poll_ready "$cid_es" "http://${ip_es}:9200/" -u 'elastic:testpasswd' +log 'Waiting for readiness of Logstash' +poll_ready "$cid_ls" "http://${ip_ls}:9600/_node/pipelines/main?pretty" + log 'Waiting for readiness of Logspout' -poll_ready "$cid_ls" "http://${ip_ls}/health" +poll_ready "$cid_lsp" "http://${ip_lsp}/health" # When Logspout starts, it prints the following log line: # 2021/01/07 16:14:52 # logspout v3.2.13-custom by gliderlabs