test(core): reduce the probability for `test_repeated_backup_via_device` failure
What changed, and why it matters
This commit only changes a test file and its expected screen-capture hashes. It adds a 0.1-second delay in an automated test to make the test fail less often. There is no change to the actual Trezor firmware or wallet security code, so it does not affect real users or devices.
No security action needed. This is a test-only reliability tweak. If investigating the underlying flakiness, review linked issue #5546 and PR #5499 comment for any real product behavior, but this commit itself is not a security fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/click_tests/test_repeated_backup.py to import time and insert time.sleep(0.1) before reset.cancel_backup(debug), with a TODO noting it is a workaround for issue #5546 / PR #5499 comment. It also updates the corresponding UI fixture hashes in tests/ui_tests/fixtures.json for multiple languages. No firmware, crypto, or device logic is changed.
Changed components
tests/click_tests/test_repeated_backup.pytests/ui_tests/fixtures.jsonInspect captured patch +10 / −6
diff --git a/tests/click_tests/test_repeated_backup.py b/tests/click_tests/test_repeated_backup.py
index f7a0ef230..2c4d8d345 100644
--- a/tests/click_tests/test_repeated_backup.py
+++ b/tests/click_tests/test_repeated_backup.py
@@ -14,6 +14,7 @@
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
+import time
from typing import TYPE_CHECKING
import pytest
@@ -208,6 +209,9 @@ def test_repeated_backup_via_device(
assert features.no_backup is False
assert features.recovery_status == messages.RecoveryStatus.Backup
+ # TODO: remove after #5546 (added as workaround for https://github.com/trezor/trezor-firmware/pull/5499#issuecomment-3187459469)
+ time.sleep(0.1)
+
# but if we cancel the backup at this point...
reset.cancel_backup(debug)
diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json
index 6a4d6e6f7..60b3789a1 100644
--- a/tests/ui_tests/fixtures.json
+++ b/tests/ui_tests/fixtures.json
@@ -28257,7 +28257,7 @@
"T3W1_cs_test_recovery.py::test_recovery_cancel_number_of_words": "1caaa8a62ed493a20bccd2b4fc55a1f3d7ebbaf3d3e265e41ba49b6f4a37c818",
"T3W1_cs_test_recovery.py::test_recovery_slip39_basic": "c184f520a5689bcc81aac3450e1e9145dd2c99badf62fe30ad78064d7fb328dc",
"T3W1_cs_test_recovery.py::test_recovery_slip39_issue5306": "b9339279d48b2f7ec471c72dc2178b22a50f61de08d9868f63073ccaa8a7a0e4",
-"T3W1_cs_test_repeated_backup.py::test_repeated_backup_via_device": "387a5959408889970941eede03f3a9b0a98e0de68e68f0de7140f4500fd9ba35",
+"T3W1_cs_test_repeated_backup.py::test_repeated_backup_via_device": "e52b58a3ee3c1253bb2b15b36356416cb394305e0e4088877c5c822a1f0315c7",
"T3W1_cs_test_reset_bip39.py::test_reset_bip39": "d1ae4a2f1e78a2674cd1f890c82a826e5b1072d58928abc49af2655edbb7c3e9",
"T3W1_cs_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "f349cf8f76764d34b4f67df70c7e5c9b4f08442b07b1db3c34bb826b0bf60e02",
"T3W1_cs_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "d2f9ed0d66426d37be50ff4d7ed1f28d32cf3eee4216badc18067d232c31b46f",
@@ -28315,7 +28315,7 @@
"T3W1_de_test_recovery.py::test_recovery_cancel_number_of_words": "11d9e451cf560008d403e563884bb528744ece8065fa2a577b5a362ceb7a5054",
"T3W1_de_test_recovery.py::test_recovery_slip39_basic": "dee674909470b3375ae1ba3cf1e88f269bd8a726efd4c7f3707529025fa85c42",
"T3W1_de_test_recovery.py::test_recovery_slip39_issue5306": "39a31ab23aa3de7e875e05f0ab5731d42e7836763bd9555bf6ce26b25e51b8cc",
-"T3W1_de_test_repeated_backup.py::test_repeated_backup_via_device": "f5b68fe746850d0ab608f328dd29eef443b91571f3aee08b8daf10422754da44",
+"T3W1_de_test_repeated_backup.py::test_repeated_backup_via_device": "4be1efbbf1e50495e89622f7e75e37fd1d5215b9cae995d174283377ae86d37d",
"T3W1_de_test_reset_bip39.py::test_reset_bip39": "29342d7595b7a0e9f1151f4941f2e718cec26e8eaa9eab53ff799dd0892e928f",
"T3W1_de_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "e43ad891be8a7cfd6aed5b5f07e2a8aa6ac05f652510eeab5a5e993e060c12b1",
"T3W1_de_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "858730668c17e18e346af887f13c55b3365983ebf4488b1207bc8a664716d644",
@@ -28373,7 +28373,7 @@
"T3W1_en_test_recovery.py::test_recovery_cancel_number_of_words": "ab7295937337fdce2b43bf3acd6dec9d4a5ba65b4b6ccd0c6683fefab43b1f2f",
"T3W1_en_test_recovery.py::test_recovery_slip39_basic": "f616b608ca85896b09f142a5d31adedc1ea0701c5bbfea6e09e5d540476ab829",
"T3W1_en_test_recovery.py::test_recovery_slip39_issue5306": "25605346672b5cca02e4568c9e8d0b22f8f939066553fd393f021ffaee325365",
-"T3W1_en_test_repeated_backup.py::test_repeated_backup_via_device": "7cb95837c1728b4255c0eede2ddad105cc0f548648eb0827f9a98ee8658bf48d",
+"T3W1_en_test_repeated_backup.py::test_repeated_backup_via_device": "bb213b3ebf7931f1a80325af293deb4d73ee6fb3980e36ee48d1433210d29bf3",
"T3W1_en_test_reset_bip39.py::test_reset_bip39": "8959f7f6a4651600e1467e701934d8d8c1364007e5b89a148f7a04da493f2bcb",
"T3W1_en_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "d2e01d14209c18896cc49cf6550a432987bbce50ae978c1ac3409306a9c75084",
"T3W1_en_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "7050c27bca2318fc16f0836e37acc5a7c6a95d509df7ea89143b93023c1f5c8e",
@@ -28431,7 +28431,7 @@
"T3W1_es_test_recovery.py::test_recovery_cancel_number_of_words": "8e71cb4841246e65d50b39e33262b298134238c9d5dd48f2856085fe2091cab9",
"T3W1_es_test_recovery.py::test_recovery_slip39_basic": "d442c5b4c4e2b1800f09deed3475b8ab150f7b79a6b598473b54a9519d564461",
"T3W1_es_test_recovery.py::test_recovery_slip39_issue5306": "45eded397f66cb25513a1eeb9ae185f03241af086fba1f279a316982814b68e4",
-"T3W1_es_test_repeated_backup.py::test_repeated_backup_via_device": "4f9c77707569bd60e9ad74fac4be06dbff9635b67df392fa695fb806c8956f1f",
+"T3W1_es_test_repeated_backup.py::test_repeated_backup_via_device": "d7e9ab7d760299f3e8a231ec11f98628f6446157e29b60b0a16d88a36d60143a",
"T3W1_es_test_reset_bip39.py::test_reset_bip39": "440c4cbdf817de63f313a7b164cd323c48a3be65e2e491e8961d53053e497070",
"T3W1_es_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "7fa548bd6073245adb8afe7f641804e4b482ef5668074cacf4958c52fdff5c1f",
"T3W1_es_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "abf166ffe5c36e97993a5dc019c195e9bf0da97d2c8aa588a65a92faa5ee8c69",
@@ -28489,7 +28489,7 @@
"T3W1_fr_test_recovery.py::test_recovery_cancel_number_of_words": "f922830922ae488ca42c03a8a1ae1a0404e400f912e90ad9e24de1f2ebc532da",
"T3W1_fr_test_recovery.py::test_recovery_slip39_basic": "67fd3815433fee3cd0dd9d5aa407c6b4bb3002d1cc426e42c49164bab3ed024c",
"T3W1_fr_test_recovery.py::test_recovery_slip39_issue5306": "14a025eb136b30a25108e5064065f2e50975c7494b825556843a4f25bd23f24c",
-"T3W1_fr_test_repeated_backup.py::test_repeated_backup_via_device": "76e9f2037042fa6bca059ac34ac2aa5c7c48174eb26817adc26ebafdeb911d23",
+"T3W1_fr_test_repeated_backup.py::test_repeated_backup_via_device": "6eb1857c42b96f206e2729b933ccf6f93c760083e812ceee11543cbd0dfe715d",
"T3W1_fr_test_reset_bip39.py::test_reset_bip39": "90f8325da69877f4320994e2db2fd1b1ae7a37cf4ec609a1f4e7f2402c096817",
"T3W1_fr_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "ad760ff37873228e74cefba5462f2fc9c772437ff43819c9ab4fd3c58cc33f41",
"T3W1_fr_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "e28279387a635bd8dd9f5c9eab1deed52f5b771eda0eb2b8d1701f68c8c6d82b",
@@ -28547,7 +28547,7 @@
"T3W1_pt_test_recovery.py::test_recovery_cancel_number_of_words": "47b909f23106f822f90e803f42b48240235bbd63a178df7fa306ad3daefc6e93",
"T3W1_pt_test_recovery.py::test_recovery_slip39_basic": "3c7405c9540bd80a683597c7763349c6359a8f11d30d098b0fcfe493f217b93a",
"T3W1_pt_test_recovery.py::test_recovery_slip39_issue5306": "a02a63fb4b673a8556c62fd1040998d83b6faacd2974696c8b2bf2cfebd0295c",
-"T3W1_pt_test_repeated_backup.py::test_repeated_backup_via_device": "10cca42432645ade5d8790578ae246ff8d4e0adbbffa84173ab8fa89376489a9",
+"T3W1_pt_test_repeated_backup.py::test_repeated_backup_via_device": "318499fd9b5b7d43dae007952a4c77e8d889fa5bbe8897f0d940cebeeae795b7",
"T3W1_pt_test_reset_bip39.py::test_reset_bip39": "1fc7299d25cbfb72910016996702808370e0b1c47738c7535950fe1d07ce89c0",
"T3W1_pt_test_reset_slip39_advanced.py::test_reset_slip39_advanced[16of16]": "ba3702ea9e2968bad55461d39df06669e4a48ed9cb8d64e0ff07cc1ca5795946",
"T3W1_pt_test_reset_slip39_advanced.py::test_reset_slip39_advanced[2of2]": "bd8dc8f37d4f4d563df872399aae19b0d6eae42dd0757df8063c884781ab02b6",
Why this scored 15/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.