Skip to content

fix: make example host more resilient to broken servers - #206

Merged
ochafik merged 1 commit into
mainfrom
ochafik/fix-e2e-tests
Jan 9, 2026
Merged

fix: make example host more resilient to broken servers#206
ochafik merged 1 commit into
mainfrom
ochafik/fix-e2e-tests

Conversation

@ochafik

@ochafikochafik commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes E2E test flakiness and improves host resilience to server connection failures.

Changes

  1. basic-host: Be resilient to individual server connection failures

    • Use Promise.allSettled instead of Promise.all
    • Failed connections are logged as warnings but don't crash the UI
    • Only throws if ALL servers fail to connect
  2. threejs-server: Add id to canvas for reliable screenshot masking

    • Added id="threejs-canvas" to the canvas element
    • Updated e2e test masks to use #threejs-canvas and .threejs-container
    • Fixes flaky Three.js screenshot comparisons in CI

Test plan

  • Run npm run examples:start, stop one server, verify UI continues working
  • Run E2E tests: npm run test:e2e:docker

🤖 Generated with Claude Code

@pkg-pr-new

pkg-pr-newBot commented Jan 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@206

commit: 6d3c85f

@ochafik
ochafik requested a review from antonpk1January 7, 2026 14:01
@ochafik
ochafik marked this pull request as ready for review January 7, 2026 14:01
1. video-resource-server: Add missing server-utils.ts and fix import path
- Was importing from non-existent ../shared/server-utils.js
- Now correctly imports from ./src/server-utils.js
2. basic-host: Be resilient to individual server connection failures
- Use Promise.allSettled instead of Promise.all
- Failed connections are logged as warnings but don't crash the UI
- Only throws if ALL servers fail to connect
3. threejs-server: Add id to canvas for reliable screenshot masking
- Added id="threejs-canvas" to the canvas element
- Updated e2e test masks to use #threejs-canvas and .threejs-container
- Fixes flaky Three.js screenshot comparisons in CI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@ochafikochafik changed the title fix: E2E test fixes and host resilience improvementsfix: E2E test stability and host resilience improvementsJan 7, 2026
@ochafik
ochafikforce-pushed the ochafik/fix-e2e-tests branch from e920bce to 6d3c85fCompareJanuary 7, 2026 14:09
@ochafikochafik changed the title fix: E2E test stability and host resilience improvementsfix: make example host more resilient to broken serversJan 7, 2026
@ochafik
ochafik merged commit 7eb98ad into mainJan 9, 2026
19 checks passed
@ochafikochafik mentioned this pull request Jan 9, 2026
ochafik added a commit that referenced this pull request Jan 9, 2026
Merge latest changes from main including:
- Vue, Svelte, Preact, and Solid basic server examples (#141)
- safeAreaInsets support (#202)
- E2E test fixes (#206)
- npm publishing for examples (#184)
- ui.resourceUri optional (#210)
- Method names as consts (#192)
- toolInfo.id optional (#216)
- PostMessageTransport security fixes (#207, #208)
- Server-utils.ts refactoring
@ochafik
ochafik deleted the ochafik/fix-e2e-tests branch January 12, 2026 21:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ochafik