summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-10-23 15:08:35 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-29 14:17:17 +0000
commit0209c679890f6909a20b31cf9ec58941aa7c4177 (patch)
tree7a857df6158115bc14643025c5a29016e7c29f86
parentbd5e246ff05ac035195fa6358f4abd598683d7c8 (diff)
downloadbuildstream-0209c679890f6909a20b31cf9ec58941aa7c4177.tar.gz
testing/runcli: node._reset_global_state on run
Clear up some errors when running tests with `BST_FORCE_START_METHOD=spawn`.
-rw-r--r--src/buildstream/testing/runcli.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/buildstream/testing/runcli.py b/src/buildstream/testing/runcli.py
index 6c3ab3496..36426c8af 100644
--- a/src/buildstream/testing/runcli.py
+++ b/src/buildstream/testing/runcli.py
@@ -51,7 +51,7 @@ from _pytest.capture import MultiCapture, FDCapture, FDCaptureBinary
# Import the main cli entrypoint
from buildstream._frontend import cli as bst_cli
-from buildstream import _yaml
+from buildstream import _yaml, node
from buildstream._cas import CASCache
from buildstream.element import _get_normal_name, _compose_artifact_name
@@ -315,6 +315,15 @@ class Cli():
#
def run(self, configure=True, project=None, silent=False, env=None,
cwd=None, options=None, args=None, binary_capture=False):
+
+ # We don't want to carry the state of one bst invocation into another
+ # bst invocation. Since node _FileInfo objects hold onto BuildStream
+ # projects, this means that they would be also carried forward. This
+ # becomes a problem when spawning new processes - when pickling the
+ # state of the node module we will also be pickling elements from
+ # previous bst invocations.
+ node._reset_global_state()
+
if args is None:
args = []
if options is None: