Browse Source

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.
Marek Marczykowski-Górecki 4 years ago
parent
commit
4fa45dbc91
1 changed files with 3 additions and 0 deletions
  1. 3 0
      qubes/tests/integ/basic.py

+ 3 - 0
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)