Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ async function httpStatusCode(url: URL, ignoreHTTPSErrors: boolean, onLog?: (dat
}

export function decorateServer(server: net.Server) {
// Windows named-pipe servers pre-post only 4 accept instances by default,
// so concurrent clients can transiently fail to connect. Node reads this
// env var when a server starts listening on a pipe.
if (process.platform === 'win32')
process.env.NODE_PENDING_PIPE_INSTANCES ??= '32';
const sockets = new Set<net.Socket>();
server.on('connection', socket => {
sockets.add(socket);
Expand Down
4 changes: 2 additions & 2 deletions tests/mcp/annotate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ test('should switch screencast to -s session on show --annotate', async ({ conne
await cli('-s=first', 'show', { bindTitle });
const browser = await connectToDashboard(bindTitle);
const dashboard = browser.contexts()[0].pages()[0];
await expect(dashboard.locator('#display')).toBeVisible();
await expect(dashboard.locator('#display')).toBeVisible({ timeout: 15_000 });

const sampleCenter = () => dashboard.evaluate(() => {
const img = document.querySelector('#display') as HTMLImageElement | null;
Expand All @@ -480,7 +480,7 @@ test('should switch screencast to -s session on show --annotate', async ({ conne
void annotatePromise.finally(() => { done = true; });

await expect(dashboard.getByRole('main', { name: 'Dashboard: annotate' })).toBeVisible({ timeout: 15_000 });
await expect(activeSession(dashboard)).toHaveAccessibleName('Session second');
await expect(activeSession(dashboard)).toHaveAccessibleName('Session second', { timeout: 15_000 });

await expect.poll(async () => {
const c = await sampleCenter();
Expand Down
Loading