diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-07-31 12:49:50 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-07-31 12:49:50 +0000 |
commit | 31170280362e6a9827aee0090ef19b875245f0df (patch) | |
tree | 4bfe237095be6db9d4122f71ea9e427eb0a68bf6 | |
parent | 6a00f5c7793006abcd3ce5b147affc9a1b086ad4 (diff) | |
parent | 53c1a7e46091ef337dea64f1e8695d8ce779d476 (diff) | |
download | subplot-31170280362e6a9827aee0090ef19b875245f0df.tar.gz |
Merge branch 'ci-timestampps' into 'main'
test: sleep for a second before running docgen
Closes #206
See merge request subplot/subplot!194
-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", |