summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-11-07 19:51:20 +0100
committerEvgeny Vereshchagin <evvers@ya.ru>2016-11-07 21:51:20 +0300
commit5209e9afd2d5326c78bcc3520ae0476dbd0e834d (patch)
treeb93fb6251925fe1ee156f4d9fcc0d72d967d3d68
parentbdb4e0cb646ff33ecbb1cf4b502870f84bf4016d (diff)
tests: use less aggressive systemctl --wait timeout in TEST-03-JOBS (#4606)
If the "systemctl start" happens at an "unlucky" time such as 1000.9 seconds and then e. g. runs for 2.6 s (sleep 2 plus the overhead of starting the unit and waiting for it) the END_SEC would be 1003.5s which would round to 1004, making the difference 4. On busier testbeds the overhead apparently can take a bit more than 0.5s. The main point is really that it doesn't wait that much longer, so "-le 4" seems perfectly fine. We allow up to 1.5s in the subsequent "wait5fail" test below too. Fixes #4582
-rwxr-xr-xtest/TEST-03-JOBS/test-jobs.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh
index fa6cf4181a..48926290a6 100755
--- a/test/TEST-03-JOBS/test-jobs.sh
+++ b/test/TEST-03-JOBS/test-jobs.sh
@@ -68,7 +68,7 @@ START_SEC=$(date -u '+%s')
systemctl start --wait wait2.service || exit 1
END_SEC=$(date -u '+%s')
ELAPSED=$(($END_SEC-$START_SEC))
-[[ "$ELAPSED" -ge 2 ]] && [[ "$ELAPSED" -le 3 ]] || exit 1
+[[ "$ELAPSED" -ge 2 ]] && [[ "$ELAPSED" -le 4 ]] || exit 1
# wait5fail fails, so systemctl should fail
START_SEC=$(date -u '+%s')