Skip to content

Flaky desktop test: an_unreachable_server_is_reported_without_the_media_link can lose its free port #2002

Closed

Description

@mbeisser1

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.

Activity

  1. mbeisser1 commented on Oct 10, 2026

    @mbeisser1
    MemberAuthor

    This was generated by AI during triage.

    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.

  2. added
    bugSomething isn't working
    ready-for-agentFully specified, ready for an AFK agent
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions