diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-10 15:07:01 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-10 16:53:56 +0900 |
commit | 2174db010d61d1a3af7bfbab97afcdc4b8b49858 (patch) | |
tree | b3687687b1e959ce09e526106ba7548183fe7893 | |
parent | 886a836effa2ddaf740a1281487356e775d0c4f0 (diff) | |
download | buildstream-2174db010d61d1a3af7bfbab97afcdc4b8b49858.tar.gz |
tests/artifactcache/expiry.py: Fix test case expectations.
-rw-r--r-- | tests/artifactcache/expiry.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py index 6190ae814..980710957 100644 --- a/tests/artifactcache/expiry.py +++ b/tests/artifactcache/expiry.py @@ -196,6 +196,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) @@ -204,6 +220,9 @@ def test_never_delete_dependencies(cli, datafiles, tmpdir): cli.configure({ 'cache': { 'quota': 10000000 + }, + 'scheduler': { + 'builders': 1 } }) |