1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 12:08:59 +00:00

feat(tests): sync received responses

to prevent "unexpected response to Initialize" errors
This commit is contained in:
matejcik 2024-04-11 13:48:00 +02:00 committed by matejcik
parent 2ddb811683
commit 617db52f43
2 changed files with 2 additions and 0 deletions

View File

@ -286,6 +286,7 @@ def client(
_raw_client.reset_debug_features()
_raw_client.open()
try:
_raw_client.sync_responses()
_raw_client.init_device()
except Exception:
request.session.shouldstop = "Failed to communicate with Trezor"

View File

@ -61,6 +61,7 @@ def screen_recording(
yield
finally:
client.ensure_open()
client.sync_responses()
# Wait for response to Initialize, which gives the emulator time to catch up
# and redraw the homescreen. Otherwise there's a race condition between that
# and stopping recording.