diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-07-31 10:08:56 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-07-31 10:08:56 +0300 |
commit | 53c1a7e46091ef337dea64f1e8695d8ce779d476 (patch) | |
tree | 4bfe237095be6db9d4122f71ea9e427eb0a68bf6 | |
parent | 6a00f5c7793006abcd3ce5b147affc9a1b086ad4 (diff) | |
download | subplot-53c1a7e46091ef337dea64f1e8695d8ce779d476.tar.gz |
test: sleep for a second before running docgen
Sponsored-by: author
-rwxr-xr-x | check | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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", |