tests: Adding three more seconds to wait for health check (#2810)

This commit is contained in:
Casper 2022-10-02 23:25:09 +02:00 committed by GitHub
parent 4ab23061a1
commit c52211b950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -4,7 +4,6 @@ export IMAGE_NAME
IMAGE_NAME="${NAME}"
setup_file() {
export START_TIME
local PRIVATE_CONFIG
PRIVATE_CONFIG=$(duplicate_config_for_container . mail)
mv "${PRIVATE_CONFIG}/user-patches/user-patches.sh" "${PRIVATE_CONFIG}/user-patches.sh"
@ -42,7 +41,6 @@ setup_file() {
--health-cmd "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1" \
"${NAME}"
START_TIME=$(date +%s)
wait_for_finished_setup_in_container mail
# generate accounts after container has been started
@ -112,14 +110,11 @@ teardown_file() {
# Be careful with re-locating this test if earlier tests could potentially fail it by
# triggering the `changedetector` service.
@test "checking container healthcheck" {
local NOW
NOW=$(date +%s)
# ensure, that at least 30 seconds have passed since container start
while (( NOW - START_TIME < 31 )); do
while [[ "$(docker inspect --format='{{.State.Health.Status}}' mail)" == "starting" ]]; do
sleep 1
NOW=$(date +%s)
done
run bash -c "docker inspect mail | jq -r '.[].State.Health.Status'"
run docker inspect --format='{{.State.Health.Status}}' mail
assert_output "healthy"
assert_success
}