Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flaky system-tests-firefox job #18848

Merged
merged 10 commits into from
Nov 15, 2021
2 changes: 1 addition & 1 deletion packages/server/lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) {

${arg1.stack}`
case 'CDP_RETRYING_CONNECTION':
return `Failed to connect to ${arg2}, retrying in 1 second (attempt ${chalk.yellow(arg1)}/62)`
return `Still waiting to connect to ${arg2}, retrying in 1 second (attempt ${chalk.yellow(arg1)}/62)`
case 'DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS':
return stripIndent`\
Deprecation Warning: The \`before:browser:launch\` plugin event changed its signature in version \`4.0.0\`
Expand Down
4 changes: 2 additions & 2 deletions packages/server/test/unit/browsers/protocol_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('lib/browsers/protocol', () => {
log.getCalls().forEach((log, i) => {
const line = stripAnsi(log.args[0])

expect(line).to.include(`Failed to connect to FooBrowser, retrying in 1 second (attempt ${i + 18}/62)`)
expect(line).to.include(`Still waiting to connect to FooBrowser, retrying in 1 second (attempt ${i + 18}/62)`)
})

snapshot(delays)
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('lib/browsers/protocol', () => {
log.getCalls().forEach((log, i) => {
const line = stripAnsi(log.args[0])

expect(line).to.include(`Failed to connect to FooBrowser, retrying in 1 second (attempt ${i + 18}/62)`)
expect(line).to.include(`Still waiting to connect to FooBrowser, retrying in 1 second (attempt ${i + 18}/62)`)
})
})
})
Expand Down
2 changes: 2 additions & 0 deletions system-tests/lib/system-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ const normalizeStdout = function (str, options: any = {}) {
.replace(/^(\- )(\/.*\/packages\/server\/)(.*)$/gm, '$1$3')
// Different browsers have different cross-origin error messages
.replace(crossOriginErrorRe, '[Cross origin error message]')
// Replaces connection warning since Firefox sometimes takes longer to connect
.replace(/Still waiting to connect to Firefox, retrying in 1 second \(attempt .+\/.+\)/g, '')

if (options.sanitizeScreenshotDimensions) {
// screenshot dimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('taking screenshots', () => {
const total = first + second + third + fourth
const padding = 2000 // account for slower machines

expect(duration).to.be.within(total, total + padding)
expect(duration).to.be.within(total - padding, total + padding)
},
})
})
Expand Down