Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: adjust gha agent params (#13509)

Yury Semikhatskyae4d2e75aab2
diff --git a/packages/playwright-core/src/grid/githubGridFactory.ts b/packages/playwright-core/src/grid/githubGridFactory.ts
index 3e6b8b3904..a1bdac9253 100644
--- a/packages/playwright-core/src/grid/githubGridFactory.ts
+++ b/packages/playwright-core/src/grid/githubGridFactory.ts
@@ -30,9 +30,10 @@ const log = debug(`pw:grid:server`);
const githubFactory: GridFactory = {
name: 'Agents hosted on Github',
- capacity: 10,
- launchTimeout: 30000,
- retireTimeout: 600000,
+ // Standard VM is 3-core on mac and 2-core on win and lin
+ capacity: 4,
+ launchTimeout: 10 * 60_000,
+ retireTimeout: 1 * 60 * 60_000,
launch: async (options: GridAgentLaunchOptions) => {
await createWorkflow(options);
},
diff --git a/packages/playwright-core/src/grid/gridServer.ts b/packages/playwright-core/src/grid/gridServer.ts
index 053c5e8ccb..728193607f 100644
--- a/packages/playwright-core/src/grid/gridServer.ts
+++ b/packages/playwright-core/src/grid/gridServer.ts
@@ -248,18 +248,12 @@ export class GridServer {
this._wsServer.shouldHandle = request => {
this._log(request.url);
- if (request.url!.startsWith(this._securePath('/claimWorker'))) {
+ if (request.url!.startsWith(this._securePath('/claimWorker')) ||
+ request.url!.startsWith(this._securePath('/registerAgent')) ||
+ request.url!.startsWith(this._securePath('/registerWorker'))) {
// shouldHandle claims it accepts promise, except it doesn't.
return true;
}
-
- if (request.url!.startsWith(this._securePath('/registerAgent'))
- || request.url!.startsWith(this._securePath('/registerWorker'))) {
- const params = new URL('http://localhost/' + request.url).searchParams;
- const agentId = params.get('agentId');
- return !!agentId && this._agents.has(agentId);
- }
-
return false;
};