summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-10-24 13:12:27 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2017-10-25 17:32:56 +0100
commitcf3ab8ddc6d0fa57323e36d4ef33228d63378bfa (patch)
tree0d26566d5422294c7bb1ada6d117f10ed9e64c40
parentb14a0c575991f3b75aa15b21b2652186b62d0a09 (diff)
downloadbuildstream-107-failing-child-processes-when-tracking-missing-git-branches.tar.gz
Issue #107: Stop attaching the child watcher multiple times107-failing-child-processes-when-tracking-missing-git-branches
-rw-r--r--buildstream/_scheduler/job.py1
-rw-r--r--buildstream/_scheduler/scheduler.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/buildstream/_scheduler/job.py b/buildstream/_scheduler/job.py
index 9ac70c77c..7c7c29bb7 100644
--- a/buildstream/_scheduler/job.py
+++ b/buildstream/_scheduler/job.py
@@ -114,7 +114,6 @@ class Job():
# Wait for it to complete
self.watcher = asyncio.get_child_watcher()
- self.watcher.attach_loop(self.scheduler.loop)
self.watcher.add_child_handler(self.pid, self.child_complete, self.element)
# shutdown()
diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py
index 58a739c4b..f5f0664c1 100644
--- a/buildstream/_scheduler/scheduler.py
+++ b/buildstream/_scheduler/scheduler.py
@@ -112,7 +112,10 @@ class Scheduler():
for queue in queues:
queue.attach(self)
+ # Ensure that we have a fresh new event loop, in case we want
+ # to run another test in this thread.
self.loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(self.loop)
# Add timeouts
if self.ticker_callback: