tests: wait for DispVM's qubes.VMShell exit
It isn't enough to wait for window to disappear, the service may still be running. And if it is, test cleanup logic will complain about FD leak. To avoid deadlock on some test failure, do it with a timeout.
This commit is contained in:
parent
240b1dd75e
commit
c4a84b3298
@ -23,6 +23,7 @@ import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from contextlib import suppress
|
||||
|
||||
from distutils import spawn
|
||||
|
||||
@ -162,8 +163,15 @@ class TC_20_DispVMMixin(object):
|
||||
self.enter_keys_in_window(window_title, ['Return'])
|
||||
# Wait for window to close
|
||||
self.wait_for_window(window_title, show=False)
|
||||
finally:
|
||||
p.stdin.close()
|
||||
self.loop.run_until_complete(
|
||||
asyncio.wait_for(p.wait(), 30))
|
||||
except:
|
||||
with suppress(ProcessLookupError):
|
||||
p.terminate()
|
||||
self.loop.run_until_complete(p.wait())
|
||||
raise
|
||||
finally:
|
||||
del p
|
||||
finally:
|
||||
self.loop.run_until_complete(dispvm.cleanup())
|
||||
|
Loading…
Reference in New Issue
Block a user