From a7b124d6daad5c06b5572037c017363fd603343a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 3 Nov 2015 02:47:08 +0100 Subject: [PATCH] tests: fix race condition in copy-paste test Don't wait arbitrary time for paste to finish. --- tests/vm_qrexec_gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/vm_qrexec_gui.py b/tests/vm_qrexec_gui.py index 8bc1a1db..08cdc715 100644 --- a/tests/vm_qrexec_gui.py +++ b/tests/vm_qrexec_gui.py @@ -940,13 +940,13 @@ class TC_30_Gui_daemon(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase): # Then paste it to the other window window_title = 'user@{}'.format(testvm2.name) - testvm2.run('zenity --entry --title={} > test.txt'.format( - window_title)) + p = testvm2.run('zenity --entry --title={} > test.txt'.format( + window_title), passio_popen=True) self.wait_for_window(window_title) subprocess.check_call(['xdotool', 'key', '--delay', '100', 'ctrl+shift+v', 'ctrl+v', 'Return']) - time.sleep(0.5) + p.wait() # And compare the result (test_output, _) = testvm2.run('cat test.txt',