From 12a59b88a584e76692795beeb26d0e8d71cf1b04 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 11 Apr 2024 13:48:00 +0200 Subject: [PATCH] feat(tests): sync received responses to prevent "unexpected response to Initialize" errors --- tests/conftest.py | 1 + tests/ui_tests/__init__.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index d6bf1f3d2..e3d5be0e4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -231,6 +231,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" diff --git a/tests/ui_tests/__init__.py b/tests/ui_tests/__init__.py index a6fb01349..c7ab04a45 100644 --- a/tests/ui_tests/__init__.py +++ b/tests/ui_tests/__init__.py @@ -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.