mirror of
https://github.com/esphome/esphome.git
synced 2026-08-23 06:36:23 +00:00
Download a wave of registry libraries in parallel
The walk now drains its frontier, prefetches the wave's registry archives with a small thread pool (deduped by URL, progress bars suppressed per thread since parallel bars would interleave), and then processes the wave sequentially; the sequential download() call stays authoritative so failures surface with resume exactly as before. Same approach as the espidf tool prefetch in #18513.
This commit is contained in:
@@ -2091,3 +2091,21 @@ class TestGetProjectCxxCompileFlags:
|
||||
def test_empty_flags(self) -> None:
|
||||
with patch("esphome.core.CORE", _make_core_cxx(set())):
|
||||
assert get_project_cxx_compile_flags() == []
|
||||
|
||||
|
||||
def test_suppress_download_progress_is_thread_local() -> None:
|
||||
"""The bar suppression only affects the thread that entered the context."""
|
||||
import threading
|
||||
|
||||
from esphome import framework_helpers as fh
|
||||
|
||||
seen: list[bool] = []
|
||||
with fh.suppress_download_progress():
|
||||
assert getattr(fh._PROGRESS_LOCAL, "disabled", False) is True
|
||||
thread = threading.Thread(
|
||||
target=lambda: seen.append(getattr(fh._PROGRESS_LOCAL, "disabled", False))
|
||||
)
|
||||
thread.start()
|
||||
thread.join()
|
||||
assert seen == [False]
|
||||
assert getattr(fh._PROGRESS_LOCAL, "disabled", False) is False
|
||||
|
||||
Reference in New Issue
Block a user