summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
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",