fix(expect): report target close reason instead of internal protocol error - #42861
Pavel Feldman (pavelfeldman) merged 1 commit into
Conversation
…error When the target closes while an expect poll has a CDP call in flight, the call rejects with the raw "Internal server error, session closed." protocol error. Frame.expect wraps it into ExpectError, so the dispatcher never gets a chance to substitute the close reason. Extract the dispatcher's close-reason rewriting into a shared helper and apply it in Frame.expect as well. Also use the close message as the error detail when the target closed before any intermediate result was collected, instead of reporting a fabricated empty received value.
Test results for "tests 1"5 flaky52088 passed, 1252 skipped Merge workflow run. |
Test results for "MCP"2 failed 8690 passed, 1474 skipped Merge workflow run. |
🟡 One known flake, one I can't clearHi, I'm the Playwright bot and I triaged the two MCP failures. The Firefox DetailsThe diff is confined to error rewriting on target close ( Pre-existing flake / infra
Uncertain
Triaged by the Playwright bot - agent run |
091e4b9
into
microsoft:main
Summary
Internal server error, session closed.protocol error.Frame.expectwraps it intoExpectError, so the dispatcher never gets to substitute the close reason.Frame.expecttoo, so the call log shows e.g.Test ended.