summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-07-31 10:08:56 +0300
committerLars Wirzenius <liw@liw.fi>2021-07-31 10:08:56 +0300
commit53c1a7e46091ef337dea64f1e8695d8ce779d476 (patch)
tree4bfe237095be6db9d4122f71ea9e427eb0a68bf6 /check
parent6a00f5c7793006abcd3ce5b147affc9a1b086ad4 (diff)
downloadsubplot-53c1a7e46091ef337dea64f1e8695d8ce779d476.tar.gz
test: sleep for a second before running docgen
Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck15
1 files changed, 15 insertions, 0 deletions
diff --git a/check b/check
index c0f26fb..1220ad8 100755
--- a/check
+++ b/check
@@ -4,6 +4,7 @@ import argparse
import glob
import os
import sys
+import time
from subprocess import PIPE, DEVNULL, STDOUT
@@ -121,6 +122,20 @@ class Runcmd:
def docgen(self, md, output, **kwargs):
"""Run the Subplot document generator"""
+
+ # GitLab CI, and other CI engines, runs tests under Docker, which uses
+ # an overlay file system, which at least sometimes only has full-second
+ # time stamps in file meta data, and sometimes that seems to happen
+ # when the kernel needs to flush its inode cache, and so it's not very
+ # deterministic. This leads to occasional test failures. To prevent
+ # such flaky tests, we wait for a second to make sure the time stamp of
+ # the output will be newer than the input has.
+ #
+ # This is an ugly kluge. It would be possible to check if the sleep is
+ # needed, but that kind of code is going to be tricky. Best avoid
+ # tricky code in test suites. Test code should be obviously correct.
+ time.sleep(1)
+
self.cargo(
[
"run",