Skip to content

[v2] e2e protocol:timeout:reset-on-progress leaves unhandled rejections on its known-failing SSE variants, so vitest exits 1 on macOS #3170

Open

Description

@JQ100

What happens

On macOS, pnpm test:all reports every test as passed or expected-fail, but vitest still exits 1 because of unhandled rejections:

Unhandled Rejection
SdkError: Request timed out
 ❯ timeoutHandler ../../packages/core-internal/src/shared/protocol.ts:1583:49
 ...
 ❯ FakeTimers.advanceTimersByTime
 ❯ checkCallback          (vi.waitFor)
Serialized Error: { code: 'REQUEST_TIMEOUT', data: { timeout: 200 } }

Upstream CI on Linux runs the same suite with the same expected failures and reports no unhandled errors, so this only shows up locally.

Where it comes from

protocol:timeout:reset-on-progress lists sse under knownFailures in test/e2e/requirements.ts (the SSE batching race shared with protocol:progress:callback). On those two variants the test fails as expected at:

await vi.waitFor(() => expect(received.length).toBeGreaterThanOrEqual(i));

While vi.waitFor polls, it advances the fake clock, so the 200ms request timeout fires and call rejects. The test has already left the path that reaches await call, and nothing else handles call, so the rejection is reported as unhandled.

Isolating by transport (-t in test/e2e, main + #3130, macOS, Node 24.16.0, 3 runs each):

Variants Result
reset-on-progress [sse ...] only 2 expected fail, 1–2 unhandled errors every run
reset-on-progress, all other transports 10 passed, no errors

Possible fix

Attach a handler right after call is created, as protocol:timeout:max-total already does:

call.catch(() => {});

The passing variants still await call and assert on the result, so nothing is lost. I tried it locally: reset-on-progress still gives 10 passed and 2 expected fail with no unhandled errors (3 runs), and the full e2e suite exits 0 (3126 passed, 141 expected fail).

I haven't looked into why Linux doesn't report these rejections. Happy to open a one-line test-only PR once #3130 is settled.

Context

Found while working on #3045 / #3130. That issue attributed an unhandled Request timed out to max-total; it was this test, as the #3130 description notes.

Activity

  1. added
    v2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
    v1Issues / PRs related to v1.x
    on Nov 10, 2026
  2. media-ctrl commented on Nov 11, 2026

    @media-ctrl
  3. added a commit that references this issue on Nov 20, 2026
    2980e8d
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

    v1Issues / PRs related to v1.xv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions