Skip to content

Commit

Permalink
Remove likely unnecessary timeout settings
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Aug 23, 2024
1 parent 3439fe8 commit 6328a3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/e2e/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type BrowserTestOutput = {
}

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

export const connect = () => {

Expand All @@ -52,7 +52,7 @@ export const connect = () => {
});

const browserURL = `http://localhost:${electronDebugPort}`
const browser = output.browser = await puppeteer.launch({ headless: 'new', timeout: launchProtocolTimeout, protocolTimeout: launchProtocolTimeout, dumpio: true})
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 All @@ -62,11 +62,10 @@ export const connect = () => {

// Connect to browser WS Endpoint
const browserWSEndpoint = endpoint.replace('localhost', '0.0.0.0')
output.browser = await puppeteer.connect({ browserWSEndpoint, defaultViewport: null, protocolTimeout: launchProtocolTimeout})
output.browser = await puppeteer.connect({ browserWSEndpoint, defaultViewport: null, protocolTimeout: protocolTimeout})

const pages = await output.browser.pages()
output.page = pages[0]
output.page.setDefaultTimeout(launchProtocolTimeout);

}, beforeStartTimeout + 1000)

Expand Down
1 change: 1 addition & 0 deletions tests/e2e/tutorial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('E2E Test', () => {
const datasetTestFunction = config.regenerateTestData ? test : test.skip

// Wait up to 10 minutes for dataset generation
// Both the test timeout and the protocolTimeout on puppeteer.connect() must be set to 10 min
datasetTestFunction('Create tutorial dataset', { timeout: 10 * 60 * 1000 }, async () => {

await evaluate(async () => {
Expand Down

0 comments on commit 6328a3f

Please sign in to comment.