Skip to content

Commit

Permalink
Increase beforeStartTimeout for failing macos example data test
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Aug 23, 2024
1 parent 6328a3f commit 03da3e5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/e2e/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const beforeStart = (timeout) => new Promise(async (resolve, reject) => {
process.stdout.on('data', handleOutput);
process.stderr.on('data', handleOutput);
process.on('close', (code) => console.log(`[electron] Exited with code ${code}`));
await sleep(timeout) // Wait for five seconds for Electron to open
await sleep(timeout)

reject('Failed to open Electron window successfully.')
})
Expand All @@ -33,15 +33,13 @@ type BrowserTestOutput = {
browser?: puppeteer.Browser,
}

const beforeStartTimeout = 60 * 1000 // Wait for 1 minute for Electron to open (mostly for Windows)
const beforeStartTimeout = 2 * 60 * 1000 // Wait 2 minutes for Electron to open
const protocolTimeout = 10 * 60 * 1000 // Creating the test dataset can take up to 10 minutes (mostly for Windows)

export const connect = () => {


const output: BrowserTestOutput = {}


beforeAll(async () => {

await beforeStart(beforeStartTimeout)
Expand All @@ -52,7 +50,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' })
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

0 comments on commit 03da3e5

Please sign in to comment.