Skip to content

Commit

Permalink
Update launch protocol timeout instead
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Aug 15, 2024
1 parent 8e307fc commit 04306e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions tests/e2e/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {

Expand All @@ -43,17 +44,15 @@ export const connect = () => {

beforeAll(async () => {

await beforeStart(timeout)


await beforeStart(beforeStartTimeout)

// Ensure Electron will exit gracefully
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
mockExit.mockRestore()
});

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))
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/tutorial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {

Expand Down

0 comments on commit 04306e4

Please sign in to comment.