Skip to content

test(cli): forward tests flake when the port is taken after the CLI's port check #4797

Closed as not planned

Description

@krishicks

User Story

I'm landing the #2912 audit-event follow-ups. #4777 failed Branch Checks because of an unrelated flaky CLI forward test, so the PR needed a rerun before review.

Description

openshell-cli::sandbox_create_lifecycle_integration::sandbox_forward_background_tracks_owned_child_when_pid_discovery_fails failed on x86_64-linux with:

fake forward must bind: Os { code: 98, kind: AddrInUse, message: "Address already in use" }
...
× ssh process started but local forward listener was not reachable
╰─▶ ssh exited with status exit status: 101 before local forward listener opened on 127.0.0.1:39481

#4570 made the forward tests retry on a new port when another process takes theirs, but only when the CLI's pre-check reports "is already in use". The port can also be taken after that check passes and before the fake ssh binds it. The fake then panics with exit status 101, which the retry does not recognize, so the test fails.

Context

Definition of Done

  • Forward tests retry on a new port when the port is taken between the CLI's check and the fake ssh's bind
  • The test file passes repeatedly

Activity

  1. krishicks commented on Oct 21, 2026

    @krishicks
    CollaboratorAuthor

    Closing: a flaky-test fix doesn't need an issue. The fix is in #4799.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions