Skip to content

fix(mcp): prevent unhandled rejection in test op queue#40698

Merged
Skn0tt merged 1 commit intomainfrom
fix-40582
May 7, 2026
Merged

fix(mcp): prevent unhandled rejection in test op queue#40698
Skn0tt merged 1 commit intomainfrom
fix-40582

Conversation

@Skn0tt
Copy link
Copy Markdown
Member

@Skn0tt Skn0tt commented May 7, 2026

Summary

  • Fix unhandled promise rejection in _enqueue that crashes the MCP server on Windows CI
  • Add no-op rejection handler to _testOpQueue so the queue always resolves

The error still propagates to callers via return await next — this only prevents the serialization queue from becoming permanently broken.

Fixes flaky test_run should stop when aborted on Windows (introduced in #40582).

The _enqueue method stores _testOpQueue as the chained promise for
serialization. If fn() ever rejects, next.then(() => {}) propagates
the rejection to _testOpQueue which has no handler attached until the
next _enqueue call arrives in a later event loop turn. Node.js detects
this as an unhandled rejection and terminates the process.

The error IS still propagated to the caller via 'return await next' —
the added no-op rejection handler only prevents the queue from being
poisoned while maintaining proper error propagation semantics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test results for "MCP"

2 failed
❌ [msedge] › mcp/annotate.spec.ts:251 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest-msedge
❌ [msedge] › mcp/annotate.spec.ts:297 › should annotate via direct browser_annotate MCP call @mcp-windows-latest-msedge

7013 passed, 1058 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test results for "tests 1"

4 flaky ⚠️ [chromium-library] › library/video.spec.ts:476 › screencast › should capture static page in persistent context @smoke `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`

41651 passed, 851 skipped


Merge workflow run.

@Skn0tt Skn0tt merged commit a2f2e02 into main May 7, 2026
44 of 45 checks passed
@Skn0tt Skn0tt deleted the fix-40582 branch May 7, 2026 12:05
Sign up for free to 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.

2 participants