tests: fix race condition in copy-paste test

Don't wait arbitrary time for paste to finish.
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-03 02:47:08 +01:00
parent c30c9c7d4e
commit a7b124d6da
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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',