E2E: fix the concurrent editor routing spec's attach gate and connection deadlock - #49
Merged
Merged
Conversation
…ls through the runner API The concurrent-editor spec polled until the editor_attach *request* was seen, then fired editor_tool_call from each page's own fetch context. Core registers the session owner while handling the attach, so a tool call could arrive before registration and hang to the 60s timeout; under a full nine-worker suite the two page-owned connections also deadlock the browser's pooled connection set. Gate on requestfinished (attach response applied) and run only the two long-lived editor_tool_call invocations through Playwright's APIRequestContext, leaving the routing assertions unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
workflow.spec.ts"routes concurrent editor calls to the owning page and session" timed out intermittently under the full suite (7/12 in the PR45 authoring run, reproduced locally on merge trees and on harness's direct repeat-3). Two compounding problems:editor_attachonrequest(outgoing), then immediately firededitor_tool_call. Core registers the session's editor owner while handling the attach, so the tool call could arrive before an owner existed and hang until the 60s test timeout instead of failing with a reason.requestfinishedfires after the response is back, which is the point where the attach is actually applied.editor_tool_callinvocations were issued through each page's ownfetchfrompage.evaluate. Under the 9-worker suite these page-owned connections can deadlock the browser's pooled connection set, which is also why the timeout surfaced aspage.evaluate: Test ended/browserContext.closein cleanup. Routing only those two RPCs through Playwright's typedAPIRequestContextremoves the page-origin connection dependency; the routing assertions are unchanged.Changes
client/e2e/workflow.spec.ts: captureeditor_attachonrequestfinishedinstead ofrequest; addcallRpcFromRunnerand use it for the two concurrenteditor_tool_callinvocations only. No product/App/SSE/permission changes.Verification
npx tsc -b --noEmit: passpnpm test: 904 passedpnpm build: passpnpm test:e2e -- --grep "routes concurrent" --repeat-each=3: 3/3 passpnpm test:e2e(71 tests): 71 passed