diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-08-11 18:29:02 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-08-13 16:38:33 +0900 |
commit | 830401ba6abbced060ceb5e833a5a76fea39a743 (patch) | |
tree | 12f96d582714f0a9c49939b3be7b478fb3340e66 /tests/artifactcache/push.py | |
parent | dca535f43947543ce2dbc46b2408ed566811270e (diff) | |
download | buildstream-830401ba6abbced060ceb5e833a5a76fea39a743.tar.gz |
element.py: Early return in _initialize_state()
Instead of having an assertion here, lets just have an early return
and make the __resolved_initial_state variable internal private
(with two leading underscores).
We also stop checking for it in _pipeline.py before resolving state.
Some background:
* We only defer _initialize_state() to a later stage because
it can be a resource intensive task which interrogates the
disk or the local CAS, thus we have the Pipeline iterate
over the instantiated elements and resolve them separately
for better user feedback.
* Some "first pass" elements must have their state initialized
earlier, i.e. the "link" and "junction" elements need to be
usable during the load sequence.
Diffstat (limited to 'tests/artifactcache/push.py')
-rw-r--r-- | tests/artifactcache/push.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py index 7160e05b4..07f2c2560 100644 --- a/tests/artifactcache/push.py +++ b/tests/artifactcache/push.py @@ -36,9 +36,7 @@ def _push(cli, cache_dir, project_dir, config_file, target): # This is duplicated from Pipeline.resolve_elements() # as this test does not use the cli frontend. for e in element.dependencies(Scope.ALL): - # Determine initial element state. - if not element._resolved_initial_state: - e._initialize_state() + e._initialize_state() # Manually setup the CAS remotes artifactcache.setup_remotes(use_config=True) |