mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-02-04 01:20:23 +01:00
test: fix a spuriously failing timeout
When running repeated tests in parallel, this one eventually fails because the ei.send() doesn't trigger the expected BrokenPipeError. Use ei.dispatch() instaed and check whether the connection still exists. Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/317>
This commit is contained in:
parent
60bc264e75
commit
9ee33b019f
1 changed files with 9 additions and 2 deletions
|
|
@ -896,8 +896,15 @@ class TestEiProtocol:
|
|||
ei.dispatch()
|
||||
assert not status.connected
|
||||
assert not status.disconnected # we never get the Disconnected event
|
||||
ei.send(bytes(16))
|
||||
assert False, "We should've been disconnected by now"
|
||||
|
||||
# Might take a while but eventually we should get disconnected...
|
||||
for _ in range(10):
|
||||
if ei.connection is None:
|
||||
return
|
||||
time.sleep(0.1)
|
||||
ei.dispatch()
|
||||
else:
|
||||
assert False, "We should've been disconnected by now"
|
||||
|
||||
ei.wait_for(lambda: status.connected)
|
||||
if missing_interface in [InterfaceName.EI_DEVICE, InterfaceName.EI_SEAT]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue