summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--src/buildstream/_scheduler/scheduler.py4
-rw-r--r--src/buildstream/_stream.py1
3 files changed, 6 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f393be56b..f3f803691 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,7 +16,7 @@ stages:
variables:
PYTEST_ADDOPTS: "--color=yes"
INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache"
- PYTEST_ARGS: "--color=yes --integration -n 2"
+ PYTEST_ARGS: "--color=yes --timeout=1 --integration -n 2"
TEST_COMMAND: "tox -- ${PYTEST_ARGS}"
EXTERNAL_TESTS_COMMAND: "tox -e py{35,36,37}-external -- ${PYTEST_ARGS}"
COVERAGE_PREFIX: "${CI_JOB_NAME}."
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index 886867dfe..6ee20bd81 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -235,6 +235,10 @@ class Scheduler:
failed = any(queue.any_failed_elements() for queue in self.queues)
self.loop = None
+ # Unset the global event loop, if subprocessed
+ if subprocessed:
+ asyncio.set_event_loop_policy(None)
+
# Notify that the loop has been reset
self._notify_front(Notification(NotificationType.RUNNING))
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index e62c2550f..9fdbcd94f 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -172,6 +172,7 @@ class Stream:
# We can now launch another async
self.loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(self.loop)
self._connect_signals()
self._start_listening()
self.loop.set_exception_handler(self._handle_exception)