From e831b7ddf72f1f6e6280d3f938849a68b77873eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 19 Nov 2020 11:57:59 +0100 Subject: tests/frontend/push.py: Skip expiry test without subsecond mtime Skip an artifact expiry test in the case we don't have subsecond mtime precision. --- tests/frontend/push.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/frontend') diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 31b0b7ec3..80cf07067 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -30,6 +30,7 @@ import pytest from buildstream.exceptions import ErrorDomain from buildstream.testing import cli, generate_project # pylint: disable=unused-import from buildstream.testing.runcli import Cli +from buildstream.testing._utils.site import have_subsecond_mtime from tests.testutils import ( create_artifact_share, create_element_size, @@ -489,6 +490,15 @@ def test_recently_pulled_artifact_does_not_expire(cli, datafiles, tmpdir): project = str(datafiles) element_path = "elements" + # The artifact expiry logic relies on mtime changes, in real life second precision + # should be enough for this to work almost all the time, but test cases happen very + # quickly, resulting in all artifacts having the same mtime. + # + # This test requires subsecond mtime to be reliable. + # + if not have_subsecond_mtime(project): + pytest.skip("Filesystem does not support subsecond mtime precision: {}".format(project)) + # Create an artifact share (remote cache) in tmpdir/artifactshare # Set a 22 MB quota with create_artifact_share(os.path.join(str(tmpdir), "artifactshare"), quota=int(22e6)) as share: -- cgit v1.2.1