From 4fa45dbc915f7437d906791331b3ab93b48557d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 22 Sep 2019 04:46:39 +0200 Subject: [PATCH] tests: fix (hopefully) too short delay in 201_shutdown_event_race test Domain shutdown handling may take extended amount of time, especially on slow machine (all the LVM teardown etc). Take care of it by synchronizing using vm.startup_lock, instead of increasing constant delay. This way, the shutdown event handler needs to be started within 3s, not finish in this time. --- qubes/tests/integ/basic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/tests/integ/basic.py b/qubes/tests/integ/basic.py index 4873822f..526410ae 100644 --- a/qubes/tests/integ/basic.py +++ b/qubes/tests/integ/basic.py @@ -232,6 +232,9 @@ class TC_00_Basic(qubes.tests.SystemTestCase): self.loop.run_until_complete(asyncio.sleep(1)) # and give a chance for both domain-shutdown handlers to execute self.loop.run_until_complete(asyncio.sleep(3)) + # wait for running shutdown handler to complete + self.loop.run_until_complete(self.vm.startup_lock.acquire()) + self.vm.startup_lock.release() if self.test_failure_reason: self.fail(self.test_failure_reason)