Improve test, get rid of sleep (#2492)

This commit is contained in:
Casper 2022-03-20 13:26:23 +01:00 committed by GitHub
parent 1bfc6d944a
commit d8d4b6a189
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,11 +101,9 @@ function teardown_file() {
@test "checking ssl: manual cert changes are picked up by check-for-changes" {
printf 'someThingsChangedHere' \
>>"$(pwd)/test/test-files/ssl/${DOMAIN_SSL_MANUAL}/with_ca/ecdsa/key.ecdsa.pem"
sleep 15
run docker exec mail_manual_ssl /bin/bash -c "supervisorctl tail -3000 changedetector"
assert_output --partial 'Change detected'
assert_output --partial 'Manual certificates have changed'
run timeout 15 docker exec mail_manual_ssl bash -c "tail -F /var/log/supervisor/changedetector.log | sed '/Manual certificates have changed/ q'"
assert_success
sed -i '/someThingsChangedHere/d' "$(pwd)/test/test-files/ssl/${DOMAIN_SSL_MANUAL}/with_ca/ecdsa/key.ecdsa.pem"
}