test(core): try to avoid old emulators' crashing during upgrade tests
What changed, and why it matters
This commit is a test-only workaround that adds a one-second sleep in an upgrade test script for older Trezor emulator versions. It avoids a known emulator crash during automated recovery tests when debug and wire communication are used simultaneously. It does not change the firmware itself or fix a security vulnerability in shipped devices.
No security action required for end users. Developers may monitor issue #7052 for a proper fix to the underlying emulator crash if needed.
Security signals we found
test-only change
workaround for emulator crash in CI/upgrade tests
references prior memory optimization (#1725) and crash issue (#7052)
no firmware or production code modified
Evidence from the diff
The change modifies tests/upgrade_tests/recovery_old.py to insert time.sleep(1) for emulator versions between 2.4.2 and 2.5.3 before polling for recovery status. The commit message references PR #1725 (a memory-saving change) and issue #7052 (emulator crashes when debuglink and wirelink are used concurrently). This is a test-harness mitigation, not a firmware patch.
Changed components
tests/upgrade_tests/recovery_old.pyInspect captured patch +6 / −0
diff --git a/tests/upgrade_tests/recovery_old.py b/tests/upgrade_tests/recovery_old.py
index 44468a2e..1b9747d6 100644
--- a/tests/upgrade_tests/recovery_old.py
+++ b/tests/upgrade_tests/recovery_old.py
@@ -46,6 +46,12 @@ def enter_share(debug: "DebugLink", share: str) -> "LayoutContent":
# After all words entered, poll for recovery status to appear
import time
+ if (2, 4, 2) <= debug.version < (2, 5, 3):
+ # https://github.com/trezor/trezor-firmware/pull/1725 may crash the emulator.
+ # See https://github.com/trezor/trezor-firmware/issues/7052 for more details.
+ # As a workaround, wait a bit until the last ButtonRequest is sent and ACKed.
+ time.sleep(1)
+
for _ in range(10): # max 1 second total
time.sleep(0.1)
layout = debug.read_layout()
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.