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.
This commit is contained in:
Antoine Cotten 2021-10-28 15:05:17 +02:00
parent 29d105e663
commit c3cc7ae15c
No known key found for this signature in database
GPG Key ID: 94637E68D4A79DD0
1 changed files with 8 additions and 3 deletions

View File

@ -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