Skip to content

bug(test): middleware and interceptor unreachable-service tests flake on macOS and fail the merge queue #6196

In review

Description

@matthewgrossman

User Story

I maintain OpenShell's E2E 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

Two unit tests added or changed by #4145 fail intermittently on the Rust test (aarch64-darwin) job (macos-15-xlarge). Both expect a remote service that is down to fail straight away, but on macOS the call sometimes runs until its timeout instead:

  • openshell-supervisor-middleware tests::external_registry_attaches_same_service_under_multiple_names (crates/openshell-supervisor-middleware/src/lib.rs:5061). After the test shuts the middleware server down, the next evaluation reports StageTimeout instead of Unavailable:

    assertion `left == right` failed
      left: Some(StageTimeout)
     right: Some(Unavailable)
    
  • openshell-gateway-interceptors runtime::tests::an_unreachable_service_is_retried_only_for_a_fail_closed_binding (crates/openshell-gateway-interceptors/src/runtime.rs:775), which checks the error and elapsed time for an unreachable service.

Linux jobs haven't failed on either test.

Impact / Why This Matters

The failures started after #4145 merged on 2026-12-01. Since then, these tests have failed 7 of the roughly 30 merge_group Branch Checks runs:

Merge group Test
#5978 gateway-interceptors
#6147 supervisor-middleware
#5252 supervisor-middleware
#6099 supervisor-middleware
#6164 both
#6143 (twice) supervisor-middleware

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

Acceptance Criteria

  • Both tests pass reliably on Rust test (aarch64-darwin), or assert the down-service case in a way that doesn't depend on how fast macOS refuses a connection to a closed port.
  • Merge-queue Branch Checks stops failing on these tests.

Reproduction Steps

  1. Look at a failed merge-group Branch Checks run, for example https://github.com/ai-openshell/openshell/actions/runs/47167510743 (job Rust test (aarch64-darwin)).
  2. Locally on macOS, run the test repeatedly: cargo nextest run -p openshell-supervisor-middleware external_registry_attaches_same_service_under_multiple_names (or with --stress-count/a loop).

Environment

Activity

  1. added
    area:build
    topic:testing
    on Dec 3, 2026
  2. matthewgrossman commented on Dec 3, 2026

    @matthewgrossman
    MemberAuthor

    @shiju-nv both tests come from #4145. Could you take a look at the macOS case?

  3. self-assigned this
    on Dec 3, 2026
  4. added 2 commits that reference this issue on Dec 3, 2026
    da9b3de
    9db2289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:buildtopic:testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions