chore: fix flaky tests (net stubbing, websocket, proxy logging, Firefox system tests) (#19159)

This commit is contained in:
David Munechika
2021-12-03 11:35:04 -05:00
committed by GitHub
parent 4d35779c8a
commit 11e99fc35a
4 changed files with 10 additions and 9 deletions
+6 -5
View File
@@ -273,14 +273,15 @@ export const STDOUT_DURATION_IN_TABLES_RE = /(\s+?)(\d+ms|\d+:\d+:?\d+)/g
const diffRe = /Difference\n-{10}\n([\s\S]*)\n-{19}\nSaved snapshot text/m
const expectedAddedVideoSnapshotLines = [
'Warning: We failed processing this video.',
'This error will not alter the exit code.', '',
'This error will not alter the exit code.',
'TimeoutError: operation timed out',
'[stack trace lines]', '', '',
'[stack trace lines]',
]
const expectedDeletedVideoSnapshotLines = [
'(Video)', '',
'(Video)',
'- Started processing: Compressing to 32 CRF',
]
const sometimesAddedSpacingLine = ''
const sometimesAddedVideoSnapshotLine = '│ Video: false │'
const sometimesDeletedVideoSnapshotLine = '│ Video: true │'
@@ -303,8 +304,8 @@ const isVideoSnapshotError = (err: Error) => {
if (line.charAt(0) === '-') deleted.push(line.slice(1).trim())
}
_.pull(added, sometimesAddedVideoSnapshotLine)
_.pull(deleted, sometimesDeletedVideoSnapshotLine)
_.pull(added, sometimesAddedVideoSnapshotLine, sometimesAddedSpacingLine)
_.pull(deleted, sometimesDeletedVideoSnapshotLine, sometimesAddedSpacingLine)
return _.isEqual(added, expectedAddedVideoSnapshotLines) && _.isEqual(deleted, expectedDeletedVideoSnapshotLines)
}
@@ -24,7 +24,7 @@ describe('websockets', () => {
it('does not crash', () => {
cy.visit('http://localhost:3038/foo')
cy.log('should not crash on ECONNRESET websocket upgrade')
cy.window().then((win) => {
cy.window().then({ timeout: 10000 }, (win) => {
// see https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
return Cypress.Promise.all([
shouldCloseUrlWithCode(win, 'ws://localhost:3038/websocket', 1006),