You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky desktop test: an_unreachable_server_is_reported_without_the_media_link can lose its free port #2002
src-tauri/src/commands/download.rs, test an_unreachable_server_is_reported_without_the_media_link, binds 127.0.0.1:0, reads the port, releases the listener, and then expects nothing to answer there. Another test in the same run can bind that port in between (the httpmock servers in tool_downloads/tests.rs and the local_server tests all take ephemeral ports), and the request then reaches a live server, so the test fails. Seen once in four full src-tauri runs while fixing PR #2001; it predates that PR.
Fix: keep the listener open and accept nothing (the connect succeeds and the read times out), or use a port that cannot answer, such as a non-routable address with a short timeout, so no other test can take it.
Confirmed: the test in src-tauri/src/commands/download.rs releases its port before the request, and seven other tests in the crate start httpmock servers on ephemeral ports, so another test can take it. Brief: the test keeps the listener for its whole life and a thread accepts each connection and drops it at once, so the request fails immediately with the port never free for another test and no timeout involved; the assertions stay as they are (the message says the server could not be reached, without the Media Link). A unit test must not depend on time, so no fix that waits on reqwest's 30-second default. Test-only; no CHANGELOG entry.
Activity
mbeisser1 commentedon Oct 10, 2026
Confirmed: the test in
src-tauri/src/commands/download.rsreleases its port before the request, and seven other tests in the crate starthttpmockservers on ephemeral ports, so another test can take it. Brief: the test keeps the listener for its whole life and a thread accepts each connection and drops it at once, so the request fails immediately with the port never free for another test and no timeout involved; the assertions stay as they are (the message says the server could not be reached, without the Media Link). A unit test must not depend on time, so no fix that waits on reqwest's 30-second default. Test-only; no CHANGELOG entry.