fix: flaky system-tests-firefox job (#18848)

Co-authored-by: Zach Bloomquist <github@chary.us>
This commit is contained in:
David Munechika
2021-11-15 09:44:03 -05:00
committed by GitHub
parent 50d1070026
commit 941cef10a0
4 changed files with 6 additions and 4 deletions

View File

@@ -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\`

View File

@@ -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)
@@ -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)`)
})
})
})

View File

@@ -441,6 +441,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

View File

@@ -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)
},
})
})