From ae4d2e75aab2f6fdc0850fad966e7e52d0fadecc Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 12 Apr 2022 13:39:08 -0700 Subject: [PATCH] chore: adjust gha agent params (#13509) --- .../playwright-core/src/grid/githubGridFactory.ts | 7 ++++--- packages/playwright-core/src/grid/gridServer.ts | 12 +++--------- 2 files changed, 7 insertions(+), 12 deletions(-) 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; };