Skip to content

test(e2e): handle the reset-on-progress rejection on early exit - #3196

Open
harmenx wants to merge 1 commit into
modelcontextprotocol:mainfrom
harmenx:fix/e2e-reset-on-progress-rejection
Open

harmenx wants to merge 1 commit into
modelcontextprotocol:mainfrom
harmenx:fix/e2e-reset-on-progress-rejection

Conversation

@harmenx

@harmenx harmenx commented Nov 18, 2026

Copy link
Copy Markdown

The SSE cells of protocol:timeout:reset-on-progress throw inside vi.waitFor before the call promise is awaited, so the request's timeout rejection is left unhandled. Attach a handler as soon as the promise is created, the way protocol:timeout:max-total already does.

Fixes #3170

Motivation and Context

The SSE cells are known failures, but because nothing holds the call promise's rejection when they throw early, vitest on macOS exits 1 with an unhandled SdkError: Request timed out, even though every assertion is an expected failure. This makes the e2e run fail for the wrong reason.

How Has This Been Tested?

pnpm --filter @modelcontextprotocol/test-e2e exec vitest run scenarios/protocol.test.ts -t 'reset-on-progress': 10 passed, 2 expected fail. ESLint and Prettier are clean on the changed file. On Linux the unpatched run already exits 0; the unhandled rejection is what the issue records on macOS. The success path still awaits call and asserts the result.

Breaking Changes

None. Test-only change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Only test/e2e/scenarios/protocol.test.ts changes. The handler is attached before the progress loop, matching protocol:timeout:max-total.

@harmenx
harmenx requested a review from a team as a code owner November 18, 2026 00:06
@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2980e8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@3196

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@3196

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@3196

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@3196

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@3196

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@3196

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@3196

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@3196

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@3196

commit: 2980e8d

@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Nov 18, 2026
The SSE cells throw inside waitFor before the call promise is awaited,
so a timeout rejection is left unhandled. Attach a handler the way
protocol:timeout:max-total already does.

Fixes modelcontextprotocol#3170
@harmenx
harmenx force-pushed the fix/e2e-reset-on-progress-rejection branch from 41e3a9b to 2980e8d Compare November 20, 2026 07:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant