Skip to content
Closed
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
9 changes: 8 additions & 1 deletion packages/core/lib/v3/understudy/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ export class V3Context {
opts?.localBrowserLaunchOptions ?? null,
);
await ctx.bootstrap();
await ctx.ensureFirstTopLevelPage(getFirstTopLevelPageTimeoutMs());
// Allow connectTimeoutMs to also govern how long we wait for the first
// top-level page to appear. On slow machines the browser may need more
// time after the CDP socket is open before the initial page registers.
const firstPageTimeoutMs = Math.max(
opts?.localBrowserLaunchOptions?.connectTimeoutMs ?? 0,
getFirstTopLevelPageTimeoutMs(),
);
await ctx.ensureFirstTopLevelPage(firstPageTimeoutMs);
return ctx;
};

Expand Down
Loading