test: unflake 'should throw connection error and allow re-connecting' (#398)

Fixes
https://github.com/microsoft/playwright-mcp/actions/runs/14940263450/job/41976152764#step:8:315
This commit is contained in:
Max Schmitt 2025-05-12 09:45:09 +02:00 committed by GitHub
parent 445170a76b
commit 84664d4b09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,7 +120,12 @@ export const test = baseTest.extend<TestFixtures & TestOptions, WorkerFixtures>(
});
return `http://localhost:${port}`;
});
browserProcess?.kill();
await new Promise<void>(resolve => {
if (!browserProcess)
return resolve();
browserProcess.on('exit', () => resolve());
browserProcess.kill();
});
},
mcpHeadless: async ({ headless }, use) => {