test: make race condition on xterm close less likely
xterm is very fast on closing when application inside terminates. It is so fast with closing on keydown event that xdotool do not manage to send keyup event, resulting in xdotool crash. Add a little more time for that.
This commit is contained in:
parent
07d4f4b340
commit
45af0913f2
@ -147,8 +147,11 @@ class TC_20_DispVMMixin(object):
|
||||
self.assertTrue(dispvm.is_running())
|
||||
try:
|
||||
window_title = 'user@%s' % (dispvm.name,)
|
||||
# close xterm on Return, but after short delay, to allow
|
||||
# xdotool to send also keyup event
|
||||
p.stdin.write("xterm -e "
|
||||
"\"sh -c 'echo \\\"\033]0;{}\007\\\";read x;'\"\n".
|
||||
"\"sh -c 'echo \\\"\033]0;{}\007\\\";read x;"
|
||||
"sleep 0.1;'\"\n".
|
||||
format(window_title).encode())
|
||||
self.loop.run_until_complete(p.stdin.drain())
|
||||
self.wait_for_window(window_title)
|
||||
|
Loading…
Reference in New Issue
Block a user