diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-10-24 13:12:27 +0100 |
---|---|---|
committer | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-10-25 17:32:56 +0100 |
commit | cf3ab8ddc6d0fa57323e36d4ef33228d63378bfa (patch) | |
tree | 0d26566d5422294c7bb1ada6d117f10ed9e64c40 | |
parent | b14a0c575991f3b75aa15b21b2652186b62d0a09 (diff) | |
download | buildstream-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.py | 1 | ||||
-rw-r--r-- | buildstream/_scheduler/scheduler.py | 3 |
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: |