Skip to content

bug(test): middleware hand-over test fails on a broken pipe on macOS #6250

In review

Description

@matthewgrossman

User Story

I maintain OpenShell's test suites and land PRs through the merge queue. I need Branch Checks to pass on main's own code, so that an approved PR doesn't get dropped from the queue by a test it doesn't touch.

Problem Statement

openshell-supervisor-middleware remote::tests::unary_calls_are_answered_once_across_service_hand_overs (crates/openshell-supervisor-middleware/src/remote.rs, added in #5735) fails intermittently on the Rust test (aarch64-darwin) job. Eight callers send calls in a loop while the test hands the middleware service over to a new server ten times. A caller sometimes gets a transport error instead of an answer:

call answered across a hand-over: Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }))) }

call_with_retries resends a call only when the failure proves the service never processed it. A broken pipe on an established connection doesn't prove that, so the call fails, which is the intended behavior (see a_call_the_service_received_is_not_sent_again_after_a_reset). The test assumes every call either gets an answer or gets a failure that call_with_retries resends, but a client can write a new stream just as the draining server closes the connection.

Linux jobs haven't failed on this test.

Impact / Why This Matters

In the last 200 Branch Checks runs, the test failed 3 times, all on Rust test (aarch64-darwin):

Run Event
#6218 merge group merge_group, removed #6218 from the queue
feat/sandbox-unix-socket-forwarding/pimlock pull_request
fix/6196-macos-unreachable-service-flake/matthewgrossman pull_request

Each failure in the merge queue removes an approved PR and costs another full Branch Checks run. Re-queueing is the only workaround.

Acceptance Criteria

  • The test passes reliably on Rust test (aarch64-darwin).
  • The test still fails if a hand-over makes a call reach a handler twice, or if calls caught by a hand-over that the service never processed are no longer resent.

Reproduction Steps

  1. On macOS, run cargo nextest run -p openshell-supervisor-middleware -E 'test(unary_calls_are_answered_once_across_service_hand_overs)' repeatedly.
  2. Occasionally a caller panics with the broken-pipe transport error above.

Environment

Activity

  1. added
    area:build
    topic:testing
    on Dec 4, 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

    area:buildtopic:testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions