Skip to content

Commit

Permalink
Modified test to be less prone to timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarta committed Oct 9, 2020
1 parent 822707f commit b5daca5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qubesmanager/tests/test_qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,10 +1187,13 @@ def _run_command_and_process_events(self, command, timeout=5,

future1 = asyncio.ensure_future(self.dispatcher.listen_for_events())
self.loop.run_until_complete(asyncio.sleep(0))

future2 = asyncio.create_subprocess_exec(*command,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)

future2 = self.loop.run_until_complete(future2).wait()

if additional_timeout:
(done, pending) = self.loop.run_until_complete(
asyncio.wait({future1, future2}, timeout=timeout,
Expand Down

0 comments on commit b5daca5

Please sign in to comment.