Skip to content

Commit

Permalink
Add perf regression testing
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Feliziani <[email protected]>
  • Loading branch information
GioSensation committed Sep 29, 2023
1 parent 930e3ca commit 8d3d7ee
Show file tree
Hide file tree
Showing 4 changed files with 4,336 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration-test/helpers/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function forwardConsoleMessages (page, _opts = {}) {
*/
export async function performanceEntries (page, measureName) {
// don't measure until the entries exist
await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`)
await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`, { timeout: 2000 })

Check failure on line 218 in integration-test/helpers/harness.js

View workflow job for this annotation

GitHub Actions / test

[macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks

1) [macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks TimeoutError: page.waitForFunction: Timeout 2000ms exceeded. at ../helpers/harness.js:218 216 | export async function performanceEntries (page, measureName) { 217 | // don't measure until the entries exist > 218 | await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`, { timeout: 2000 }) | ^ 219 | const result = await page.evaluate((measureName) => { 220 | window.performance?.measure?.(measureName, `${measureName}:start`, `${measureName}:end`) 221 | const entries = window.performance?.getEntriesByName(measureName) at performanceEntries (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/harness.js:218:16) at Object.validateInitialScanPerf (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/pages.js:752:35) at /home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/tests/email-autofill.macos.spec.js:333:28

Check failure on line 218 in integration-test/helpers/harness.js

View workflow job for this annotation

GitHub Actions / test

[macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks

1) [macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: page.waitForFunction: Timeout 2000ms exceeded. at ../helpers/harness.js:218 216 | export async function performanceEntries (page, measureName) { 217 | // don't measure until the entries exist > 218 | await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`, { timeout: 2000 }) | ^ 219 | const result = await page.evaluate((measureName) => { 220 | window.performance?.measure?.(measureName, `${measureName}:start`, `${measureName}:end`) 221 | const entries = window.performance?.getEntriesByName(measureName) at performanceEntries (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/harness.js:218:16) at Object.validateInitialScanPerf (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/pages.js:752:35) at /home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/tests/email-autofill.macos.spec.js:333:28

Check failure on line 218 in integration-test/helpers/harness.js

View workflow job for this annotation

GitHub Actions / test

[macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks

1) [macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: page.waitForFunction: Timeout 2000ms exceeded. at ../helpers/harness.js:218 216 | export async function performanceEntries (page, measureName) { 217 | // don't measure until the entries exist > 218 | await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`, { timeout: 2000 }) | ^ 219 | const result = await page.evaluate((measureName) => { 220 | window.performance?.measure?.(measureName, `${measureName}:start`, `${measureName}:end`) 221 | const entries = window.performance?.getEntriesByName(measureName) at performanceEntries (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/harness.js:218:16) at Object.validateInitialScanPerf (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/pages.js:752:35) at /home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/tests/email-autofill.macos.spec.js:333:28

Check failure on line 218 in integration-test/helpers/harness.js

View workflow job for this annotation

GitHub Actions / test

[macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks

1) [macos] › email-autofill.macos.spec.js:321:9 › macos › matching performance › large dom with potentially huge regex checks Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: page.waitForFunction: Timeout 2000ms exceeded. at ../helpers/harness.js:218 216 | export async function performanceEntries (page, measureName) { 217 | // don't measure until the entries exist > 218 | await page.waitForFunction((measureName) => window.performance.getEntriesByName(measureName).length > 0, `${measureName}:end`, { timeout: 2000 }) | ^ 219 | const result = await page.evaluate((measureName) => { 220 | window.performance?.measure?.(measureName, `${measureName}:start`, `${measureName}:end`) 221 | const entries = window.performance?.getEntriesByName(measureName) at performanceEntries (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/harness.js:218:16) at Object.validateInitialScanPerf (/home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/helpers/pages.js:752:35) at /home/runner/work/duckduckgo-autofill/duckduckgo-autofill/integration-test/tests/email-autofill.macos.spec.js:333:28
const result = await page.evaluate((measureName) => {
window.performance?.measure?.(measureName, `${measureName}:start`, `${measureName}:end`)
const entries = window.performance?.getEntriesByName(measureName)
Expand Down
1 change: 1 addition & 0 deletions integration-test/helpers/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const constants = {
'emailAtBottom': 'pages/email-at-bottom.html',
'emailAtTopLeft': 'pages/email-at-top-left.html',
'scanner-perf': 'pages/scanner-perf.html',
'perf-huge-regex': 'pages/perf-huge-regex.html',
'iframeContainer': 'pages/iframe-container.html',
'signup': 'pages/signup.html',
'mutatingForm': 'pages/mutating-form.html',
Expand Down
Loading

0 comments on commit 8d3d7ee

Please sign in to comment.