summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-10 15:07:01 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-10 15:56:11 +0900
commit80e912e6ab3d457f1fcbcfb8f9bb47eb0f3399c2 (patch)
tree2afd62c2fa0eeaa321b8fa7504675b237d7dea15
parent70971f24dfe09fe89a233f22b8d6034a64d11167 (diff)
downloadbuildstream-80e912e6ab3d457f1fcbcfb8f9bb47eb0f3399c2.tar.gz
tests/artifactcache/expiry.py: Fix test case expectations.
-rw-r--r--tests/artifactcache/expiry.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py
index 3095fd6a4..9ea889815 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -175,6 +175,22 @@ def test_keep_dependencies(cli, datafiles, tmpdir):
# Assert that we never delete a dependency required for a build tree
+#
+# NOTE: This test expects that a build will fail if it attempts to
+# put more artifacts in the cache than the quota can hold,
+# and expects that the last two elements which don't fit into
+# the quota wont even be built.
+#
+# In real life, this will not be the case, since once we reach
+# the estimated quota we launch a cache size calculation job and
+# only launch a cleanup job when the size is calculated; and
+# other build tasks will be scheduled while the cache size job
+# is running.
+#
+# This test only passes because we configure `builders` to 1,
+# ensuring that the cache size job runs exclusively since it
+# also requires a compute resource (a "builder").
+#
@pytest.mark.datafiles(DATA_DIR)
def test_never_delete_dependencies(cli, datafiles, tmpdir):
project = os.path.join(datafiles.dirname, datafiles.basename)
@@ -183,6 +199,9 @@ def test_never_delete_dependencies(cli, datafiles, tmpdir):
cli.configure({
'cache': {
'quota': 10000000
+ },
+ 'scheduler': {
+ 'builders': 1
}
})