Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Aug 25, 2024
2 parents 0c9fe09 + 01908f7 commit de0ae02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/daily_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

NotifyOnAnyFailure:
runs-on: ubuntu-latest
needs: [DevTests, LiveServices, BuildTests, ExampleDataCache, ExampleDataTests]
needs: [DevTests, LiveServices, E2ELiveServices, BuildTests, ExampleDataCache, ExampleDataTests]
if: failure()
steps:
- uses: dawidd6/action-send-mail@v3
Expand Down
12 changes: 5 additions & 7 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 launchProtocolTimeout = 6 * 60 * 1000 // Creating the test dataset can take up to 6 minutes (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', protocolTimeout: launchProtocolTimeout})
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,7 +60,7 @@ 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 })
output.browser = await puppeteer.connect({ browserWSEndpoint, defaultViewport: null, protocolTimeout: protocolTimeout})

const pages = await output.browser.pages()
output.page = pages[0]
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/tutorial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ describe('E2E Test', () => {

const datasetTestFunction = config.regenerateTestData ? test : test.skip

datasetTestFunction('Create tutorial dataset', async () => {
// 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 de0ae02

Please sign in to comment.