From 19a1579a99de9d47b6543ff99ee0c280f229c4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 9 Nov 2017 11:43:39 +0100 Subject: [PATCH] tests: fix deadlock in filecopy test Error window (where test need to send Enter key) is opened while qvm-move-to-vm is still running. --- qubes/tests/integ/vm_qrexec_gui.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/qubes/tests/integ/vm_qrexec_gui.py b/qubes/tests/integ/vm_qrexec_gui.py index 8b88d2de..e6ca70e1 100644 --- a/qubes/tests/integ/vm_qrexec_gui.py +++ b/qubes/tests/integ/vm_qrexec_gui.py @@ -704,13 +704,17 @@ class TC_00_AppVMMixin(object): user='root')) with self.qrexec_policy('qubes.Filecopy', self.testvm1, self.testvm2): - with self.assertRaises(subprocess.CalledProcessError): - self.loop.run_until_complete(self.testvm1.run_for_stdio( - 'qvm-move-to-vm {} /tmp/testfile'.format( - self.testvm2.name))) + p = self.loop.run_until_complete(self.testvm1.run( + 'qvm-move-to-vm {} /tmp/testfile'.format( + self.testvm2.name))) - # Close GUI error message - self.enter_keys_in_window('Error', ['Return']) + # Close GUI error message + try: + self.enter_keys_in_window('Error', ['Return']) + except subprocess.CalledProcessError: + pass + self.loop.run_until_complete(p.wait()) + self.assertNotEqual(p.returncode, 0) # the file shouldn't be removed in source vm self.loop.run_until_complete(self.testvm1.run_for_stdio(