summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-11-19 11:57:59 +0100
committerJürg Billeter <j@bitron.ch>2020-11-24 08:23:49 +0100
commite831b7ddf72f1f6e6280d3f938849a68b77873eb (patch)
tree448c9049264462c4cced3c758f16395bcbf84ccd /tests
parent9eee3353a9342ff697e0260ffa58700b857b6288 (diff)
downloadbuildstream-e831b7ddf72f1f6e6280d3f938849a68b77873eb.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/push.py10
1 files changed, 10 insertions, 0 deletions
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: