From aee49156c9f97d47df321c25affef7e6d00d16d2 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Sun, 25 Oct 2020 19:32:49 +0900 Subject: tests/frontend/track.py: Conditionally skip a test 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. --- tests/frontend/track.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/frontend/track.py') 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. # -- cgit v1.2.1