🧪 test: Route the Benchmark and BYOM Unroutes Through the Shared Helper (#18085)

This commit is contained in:
Danny Avila 2026-11-12 09:47:24 -05:00 • committed by GitHub
parent 40671fd88c
commit fb4150e077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -132,7 +132,7 @@ context and its pages before Playwright closes it, and what a detached handler t
is ignored. A context the spec opens itself with `browser.newContext()` closes through
`closeContext(context)` from the same module.
A mock spec that removes a route before its test ends calls `unroute(page, url, handler)` from that
A spec that removes a route before its test ends calls `unroute(page, url, handler)` from that
module in place of `page.unroute()`. When `page.unroute()` removes a page's last route, Playwright
stops intercepting there and continues the requests its handlers were still working on, so a
handler in the middle of one throws `Route is already handled!` and fails the test. `unroute`

View file

@ -9,6 +9,7 @@ import {
seedMessages,
} from '../specs/mock/db';
import { messagesView } from '../specs/mock/helpers';
import { unroute } from '../specs/mock/fixtures';
import { getE2EUser } from '../setup/user';
import {
attachSnapshot,
@ -224,7 +225,7 @@ async function holdConversationRecord(page: Page, conversationId: string) {
return async () => {
release();
await page.unroute(pattern);
await unroute(page, pattern);
return heldRequests;
};
}

View file

@ -12,6 +12,7 @@ import {
sendMessage,
sendMessageAndWaitForCompletion,
} from '../specs/mock/helpers';
import { unroute } from '../specs/mock/fixtures';
interface Pairing {
environment: { id: string };
@ -345,7 +346,7 @@ test('native BYOM saves, persists, isolates workers, and fails closed', async ({
await route.continue();
});
const conversationId = await chat('Keep this conversation and its history.');
await page.unroute(streamRoute);
await unroute(page, streamRoute);
const ordinaryDecision = await readDecision(conversationId);
expect(ordinaryDecision.codeEnvironmentMode).toBe('without_attached');
expect(ordinaryDecision.codeWorkspaces ?? []).toEqual([]);