From 7d30da5d4ee54844590dbd18e8350c754435194c Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 22 May 2017 20:18:07 +0200 Subject: [PATCH] Do not wait auto start to finish in order to complete project opening Fix https://github.com/GNS3/gns3-gui/issues/2074 --- gns3server/controller/project.py | 5 ++++- tests/utils.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index c71ce360..3cf17af8 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -675,7 +675,10 @@ class Project: self._loading = False # Should we start the nodes when project is open if self._auto_start: - yield from self.start_all() + # Start all in the background without waiting for completion + # we ignore errors because we want to let the user open + # their project and fix it + asyncio.async(self.start_all()) @asyncio.coroutine def wait_loaded(self): diff --git a/tests/utils.py b/tests/utils.py index 3c638d52..a818462a 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -18,6 +18,7 @@ import io import asyncio import unittest.mock +import collections.abc class _asyncio_patch: @@ -69,6 +70,7 @@ class AsyncioMagicMock(unittest.mock.MagicMock): """ Magic mock returning coroutine """ + __class__ = collections.abc.Awaitable def __init__(self, return_value=None, return_values=None, **kwargs): """