aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-05-14 15:09:29 +0100
committerSimon McVittie <smcv@debian.org>2017-05-14 15:35:52 +0100
commit8b5c729b8b8699a1828dae2b995af13a481a5da7 (patch)
tree2b662b86dd88c47876f11618b75972e93dd63086 /t
parent365a930c2c39d1f727aa620155c179c004acdcc1 (diff)
downloadikiwiki-8b5c729b8b8699a1828dae2b995af13a481a5da7.tar
ikiwiki-8b5c729b8b8699a1828dae2b995af13a481a5da7.tar.gz
t/git-cgi.t: Wait 1 second before doing a revert that should succeed
This hopefully fixes a race condition in which the test failed around 6% of the time. If we don't wait, the mtime (which is rounded down to 1 second precision in the APIs we use) will not necessarily change, so the update will not necessarily cause the page to be refreshed. Bug-Debian: https://bugs.debian.org/862494
Diffstat (limited to 't')
-rwxr-xr-xt/git-cgi.t4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/git-cgi.t b/t/git-cgi.t
index ee77257b9..ee47261ed 100755
--- a/t/git-cgi.t
+++ b/t/git-cgi.t
@@ -291,6 +291,10 @@ sub test {
$content = readfile('t/tmp/in/two.mdwn');
like($content, qr{Here is new content for the second page});
+ # We have to wait 1 second here so that new writes are guaranteed
+ # to have a strictly larger mtime.
+ sleep 1;
+
# This one can legitimately be reverted
$content = run_cgi(method => 'post',
params => {