test(core): download emulators concurrently
What changed, and why it matters
This commit only speeds up a test-support script by downloading emulator files in parallel instead of one at a time. It does not touch the Trezor firmware, wallet logic, cryptography, or any user-facing security feature. There is no security-relevant change.
No security action needed. Review as normal code-quality/test-infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies tests/download_emulators.py to use ThreadPoolExecutor(max_workers=8) for concurrent downloads of emulator binaries. The same operations (download + chmod) are performed on the same set of URLs; only the execution order and parallelism changed. No input validation, network trust model, file path handling, or authentication logic was altered.
Changed components
tests/download_emulators.pyInspect captured patch +6 / −1
diff --git a/tests/download_emulators.py b/tests/download_emulators.py
index 17b84eb9..83a77238 100755
--- a/tests/download_emulators.py
+++ b/tests/download_emulators.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import json
import stat
+from concurrent.futures import ThreadPoolExecutor
from http import HTTPStatus
from pathlib import Path
from typing import TypeAlias
@@ -135,10 +136,14 @@ def download_emulators_for_model(model: str) -> None:
all_releases = get_all_releases()
emus = get_emulators_for_model(model, all_releases)
- for emu in emus:
+ def _run(emu: Emulator):
emu.download()
emu.set_as_executable()
+ with ThreadPoolExecutor(max_workers=8) as executor:
+ for _ in executor.map(_run, emus):
+ pass
+
@click.command()
@click.argument("model", type=click.Choice(ALL_MODEL_NAMES, case_sensitive=True))
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.