From 04306e4cdd2b019a83ee12fc05636883367f4cac Mon Sep 17 00:00:00 2001 From: rly Date: Wed, 14 Aug 2024 20:51:18 -0700 Subject: [PATCH] Update launch protocol timeout instead --- tests/e2e/puppeteer.ts | 9 ++++----- tests/e2e/tutorial.test.ts | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/e2e/puppeteer.ts b/tests/e2e/puppeteer.ts index 7a7e139a7..069a3b583 100644 --- a/tests/e2e/puppeteer.ts +++ b/tests/e2e/puppeteer.ts @@ -33,7 +33,8 @@ type BrowserTestOutput = { browser?: puppeteer.Browser, } -const timeout = 60 * 1000 // Wait for 1 minute for Electron to open (mostly for Windows) +const beforeStartTimeout = 60 * 1000 // Wait for 1 minute for Electron to open (mostly for Windows) +const launchProtocolTimeout = 6 * 60 * 1000 // Creating the test dataset can take up to 6 minutes (mostly for Windows) export const connect = () => { @@ -43,9 +44,7 @@ export const connect = () => { beforeAll(async () => { - await beforeStart(timeout) - - + await beforeStart(beforeStartTimeout) // Ensure Electron will exit gracefully const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => { @@ -53,7 +52,7 @@ export const connect = () => { }); const browserURL = `http://localhost:${electronDebugPort}` - const browser = output.browser = await puppeteer.launch({ headless: 'new' }) + const browser = output.browser = await puppeteer.launch({ headless: 'new', protocolTimeout: launchProtocolTimeout}) const page = output.page = await browser.newPage(); await page.goto(browserURL); const endpoint = await page.evaluate(() => fetch(`json/version`).then(res => res.json()).then(res => res.webSocketDebuggerUrl)) diff --git a/tests/e2e/tutorial.test.ts b/tests/e2e/tutorial.test.ts index 5f1dfb34a..67354b0d6 100644 --- a/tests/e2e/tutorial.test.ts +++ b/tests/e2e/tutorial.test.ts @@ -36,8 +36,7 @@ describe('E2E Test', () => { const datasetTestFunction = config.regenerateTestData ? test : test.skip - datasetTestFunction('Create tutorial dataset', {'timeout': 360_000}, async () => { - // Creating the dataset can take up to 6 minutes, especially on Windows + datasetTestFunction('Create tutorial dataset', async () => { await evaluate(async () => {