Skip to content

Commit 941cef1

Browse files
fix: flaky system-tests-firefox job (#18848)
Co-authored-by: Zach Bloomquist <github@chary.us>
1 parent 50d1070 commit 941cef1

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

packages/server/lib/errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) {
879879
880880
${arg1.stack}`
881881
case 'CDP_RETRYING_CONNECTION':
882-
return `Failed to connect to ${arg2}, retrying in 1 second (attempt ${chalk.yellow(arg1)}/62)`
882+
return `Still waiting to connect to ${arg2}, retrying in 1 second (attempt ${chalk.yellow(arg1)}/62)`
883883
case 'DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS':
884884
return stripIndent`\
885885
Deprecation Warning: The \`before:browser:launch\` plugin event changed its signature in version \`4.0.0\`

packages/server/test/unit/browsers/protocol_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('lib/browsers/protocol', () => {
3535
log.getCalls().forEach((log, i) => {
3636
const line = stripAnsi(log.args[0])
3737

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

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

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

system-tests/lib/system-tests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ const normalizeStdout = function (str, options: any = {}) {
441441
.replace(/^(\- )(\/.*\/packages\/server\/)(.*)$/gm, '$1$3')
442442
// Different browsers have different cross-origin error messages
443443
.replace(crossOriginErrorRe, '[Cross origin error message]')
444+
// Replaces connection warning since Firefox sometimes takes longer to connect
445+
.replace(/Still waiting to connect to Firefox, retrying in 1 second \(attempt .+\/.+\)/g, '')
444446

445447
if (options.sanitizeScreenshotDimensions) {
446448
// screenshot dimensions

system-tests/projects/e2e/cypress/integration/screenshots_spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('taking screenshots', () => {
158158
const total = first + second + third + fourth
159159
const padding = 2000 // account for slower machines
160160

161-
expect(duration).to.be.within(total, total + padding)
161+
expect(duration).to.be.within(total - padding, total + padding)
162162
},
163163
})
164164
})

0 commit comments

Comments
 (0)