summaryrefslogtreecommitdiff
path: root/tests/frontend/workspace.py
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2018-08-01 14:36:46 +0100
committerWilliam Salmon <will.salmon@codethink.co.uk>2018-08-16 10:52:38 +0100
commit177c42649a3c6633b71a0e599ae0e5275476c964 (patch)
treea6a60917e2932f570a314d31a9913bae971a2382 /tests/frontend/workspace.py
parent04f836796d6d7f45a69ae607deebf3fb5b133611 (diff)
downloadbuildstream-177c42649a3c6633b71a0e599ae0e5275476c964.tar.gz
Trying to mitigate a mtime granularity braking the cache testswillsalmon/CacheExpiryTest
This patch mitigates the granularity of the mtimes used on the default gitlab runners, Allowing the test suite to pass on these runners.
Diffstat (limited to 'tests/frontend/workspace.py')
-rw-r--r--tests/frontend/workspace.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index fff9bf00a..c7af0a70f 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1,9 +1,34 @@
+#
+# Copyright (C) 2018 Codethink Limited
+# Copyright (C) 2018 Bloomberg Finance LP
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see <http://www.gnu.org/licenses/>.
+#
+# Authors: Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
+# Tristan Maat <tristan.maat@codethink.co.uk>
+# Chandan Singh <csingh43@bloomberg.net>
+# Phillip Smyth <phillip.smyth@codethink.co.uk>
+# Jonathan Maw <jonathan.maw@codethink.co.uk>
+# Richard Maw <richard.maw@codethink.co.uk>
+#
+
import os
import pytest
import shutil
import subprocess
from ruamel.yaml.comments import CommentedSet
-from tests.testutils import cli, create_repo, ALL_REPO_KINDS
+from tests.testutils import cli, create_repo, ALL_REPO_KINDS, wait_for_cache_granularity
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadError, LoadErrorReason
@@ -507,6 +532,8 @@ def test_detect_modifications(cli, tmpdir, datafiles, modification, strict):
assert cli.get_element_state(project, element_name) == 'cached'
assert cli.get_element_key(project, element_name) != "{:?<64}".format('')
+ wait_for_cache_granularity()
+
# Modify the workspace in various different ways, ensuring we
# properly detect the changes.
#