mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-28 19:00:03 -05:00
chore: fix flaky tests (net stubbing, websocket, proxy logging, Firefox system tests) (#19159)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user