summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-10-25 19:32:49 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-10-25 19:32:49 +0900
commitaee49156c9f97d47df321c25affef7e6d00d16d2 (patch)
tree3a90d2ce8f5bce002f51267b9434a26d9e467cc7
parent3a604d784c929a9dd01eb4dc65519ea53de0df9f (diff)
downloadbuildstream-tristan/conditional-subsecond-precision.tar.gz
tests/frontend/track.py: Conditionally skip a testtristan/conditional-subsecond-precision
Skip a test which relies on mtimes differing within a short timespan, this will fail if it happens fast enough (which it should) on systems which do not support subsecond precision mtimes.
-rw-r--r--tests/frontend/track.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/frontend/track.py b/tests/frontend/track.py
index 682ee0e98..bd8444973 100644
--- a/tests/frontend/track.py
+++ b/tests/frontend/track.py
@@ -8,6 +8,7 @@ import pytest
from buildstream.testing import create_repo, generate_project
from buildstream.testing import cli # pylint: disable=unused-import
+from buildstream.testing._utils.site import have_subsecond_mtime
from buildstream.exceptions import ErrorDomain, LoadErrorReason
from buildstream import _yaml
from tests.testutils import generate_junction
@@ -366,6 +367,11 @@ def test_no_needless_overwrite(cli, tmpdir, datafiles):
element_path = os.path.join(project, "elements")
target = "track-test-target.bst"
+ # Skip this test if we do not have support for subsecond precision mtimes
+ #
+ if not have_subsecond_mtime(project):
+ pytest.skip("Filesystem does not support subsecond mtime precision: {}".format(project))
+
# Create our repo object of the given source type with
# the dev files, and then collect the initial ref.
#