Closed tom-mi closed 4 months ago
@tom-mi Oof, I can recreate. I'm really confused by this one because this was such a benign release. Let me dig in some more
@tom-mi The use of this plugin is now locking up the browser in 13.7.3. The plugin is sending a very large message to our command log. The regex check for this message changed in 13.7.3 here at this line:
When the message is sent through this line in our code, the JavaScript engine hangs due to catastrophic backtracking in that regex. I was not expecting this to come through that message.
I confirm this, I'm having the same issue too but I'm not using any plugins. Same test no change, version 13.7.2 works fine Version 13.7.3 with chrome crashes the whole browser with FF it hangs then the test fails and get this error in the console
InternalError: too much recursion
formattedMessage http://localhost:4200/__cypress/runner/cypress_runner.js:199221
Message http://localhost:4200/__cypress/runner/cypress_runner.js:199385
wrappedComponent http://localhost:4200/__cypress/runner/cypress_runner.js:188127
useObserver http://localhost:4200/__cypress/runner/cypress_runner.js:188105
trackDerivedFunction http://localhost:4200/__cypress/runner/cypress_runner.js:180861
track http://localhost:4200/__cypress/runner/cypress_runner.js:180861
useObserver http://localhost:4200/__cypress/runner/cypress_runner.js:188103
wrappedComponent http://localhost:4200/__cypress/runner/cypress_runner.js:188127
hg http://localhost:4200/__cypress/runner/cypress_runner.js:381
Mg http://localhost:4200/__cypress/runner/cypress_runner.js:397
Lg http://localhost:4200/__cypress/runner/cypress_runner.js:397
Kg http://localhost:4200/__cypress/runner/cypress_runner.js:396
Tg http://localhost:4200/__cypress/runner/cypress_runner.js:415
bi http://localhost:4200/__cypress/runner/cypress_runner.js:463
ci http://localhost:4200/__cypress/runner/cypress_runner.js:464
Di http://localhost:4200/__cypress/runner/cypress_runner.js:480
Yh http://localhost:4200/__cypress/runner/cypress_runner.js:479
Gi http://localhost:4200/__cypress/runner/cypress_runner.js:481
reactionScheduler http://localhost:4200/__cypress/runner/cypress_runner.js:180861
runReactions http://localhost:4200/__cypress/runner/cypress_runner.js:180861
endBatch http://localhost:4200/__cypress/runner/cypress_runner.js:180861
_endAction http://localhost:4200/__cypress/runner/cypress_runner.js:180861
executeAction http://localhost:4200/__cypress/runner/cypress_runner.js:180861
n http://localhost:4200/__cypress/runner/cypress_runner.js:180861
setTimeout handler*_startTimingPending http://localhost:4200/__cypress/runner/cypress_runner.js:183464
_checkLongRunning http://localhost:4200/__cypress/runner/cypress_runner.js:183456
Command http://localhost:4200/__cypress/runner/cypress_runner.js:183411
_addCommand http://localhost:4200/__cypress/runner/cypress_runner.js:183008
addLog http://localhost:4200/__cypress/runner/cypress_runner.js:182841
addLog http://localhost:4200/__cypress/runner/cypress_runner.js:182619
_withAttempt http://localhost:4200/__cypress/runner/cypress_runner.js:182748
addLog http://localhost:4200/__cypress/runner/cypress_runner.js:182618
addLog http://localhost:4200/__cypress/runner/cypress_runner.js:182363
_withTest http://localhost:4200/__cypress/runner/cypress_runner.js:182370
addLog http://localhost:4200/__cypress/runner/cypress_runner.js:182362
listen http://localhost:4200/__cypress/runner/cypress_runner.js:182069
executeAction http://localhost:4200/__cypress/runner/cypress_runner.js:180861
n http://localhost:4200/__cypress/runner/cypress_runner.js:180861
emit2 http://localhost:4200/__/assets/index-f6dca216.js:139329
_addListeners http://localhost:4200/__/assets/index-f6dca216.js:146185
emit http://localhost:4200/__cypress/runner/cypress_runner.js:141488
fn http://localhost:4200/__cypress/runner/cypress_runner.js:140394
action http://localhost:4200/__cypress/runner/cypress_runner.js:41092
trigger http://localhost:4200/__cypress/runner/cypress_runner.js:128217
triggerLog http://localhost:4200/__cypress/runner/cypress_runner.js:128222
createLogFn http://localhost:4200/__cypress/runner/cypress_runner.js:128274
type http://localhost:4200/__cypress/runner/cypress_runner.js:114375
wrapped http://localhost:4200/__cypress/runner/cypress_runner.js:138387
__stackReplacementMarker http://localhost:4200/__cypress/runner/cypress_runner.js:144077
runCommand http://localhost:4200/__cypress/runner/cypress_runner.js:144301
tryCatcher http://localhost:4200/__cypress/runner/cypress_runner.js:1807
_settlePromiseFromHandler http://localhost:4200/__cypress/runner/cypress_runner.js:1519
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1576
_settlePromiseCtx http://localhost:4200/__cypress/runner/cypress_runner.js:1613
_drainQueueStep http://localhost:4200/__cypress/runner/cypress_runner.js:2411
_drainQueue http://localhost:4200/__cypress/runner/cypress_runner.js:2400
_drainQueues http://localhost:4200/__cypress/runner/cypress_runner.js:2416
drainQueues http://localhost:4200/__cypress/runner/cypress_runner.js:2286
promise callback*schedule http://localhost:4200/__cypress/runner/cypress_runner.js:2460
_queueTick http://localhost:4200/__cypress/runner/cypress_runner.js:2425
AsyncSettlePromises http://localhost:4200/__cypress/runner/cypress_runner.js:2357
_fulfill http://localhost:4200/__cypress/runner/cypress_runner.js:1647
_resolveCallback http://localhost:4200/__cypress/runner/cypress_runner.js:1439
_resolve http://localhost:4200/__cypress/runner/cypress_runner.js:6382
completed http://localhost:4200/__cypress/runner/cypress_runner.js:6443
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1573
_settlePromise0 http://localhost:4200/__cypress/runner/cypress_runner.js:1621
_settlePromises http://localhost:4200/__cypress/runner/cypress_runner.js:1701
_fulfill http://localhost:4200/__cypress/runner/cypress_runner.js:1645
_resolveCallback http://localhost:4200/__cypress/runner/cypress_runner.js:1439
_settlePromiseFromHandler http://localhost:4200/__cypress/runner/cypress_runner.js:1531
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1576
_settlePromise0 http://localhost:4200/__cypress/runner/cypress_runner.js:1621
_settlePromises http://localhost:4200/__cypress/runner/cypress_runner.js:1701
_fulfill http://localhost:4200/__cypress/runner/cypress_runner.js:1645
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1589
_settlePromise0 http://localhost:4200/__cypress/runner/cypress_runner.js:1621
_settlePromises http://localhost:4200/__cypress/runner/cypress_runner.js:1701
_fulfill http://localhost:4200/__cypress/runner/cypress_runner.js:1645
_resolveCallback http://localhost:4200/__cypress/runner/cypress_runner.js:1439
_settlePromiseFromHandler http://localhost:4200/__cypress/runner/cypress_runner.js:1531
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1576
_settlePromise0 http://localhost:4200/__cypress/runner/cypress_runner.js:1621
_settlePromises http://localhost:4200/__cypress/runner/cypress_runner.js:1701
_fulfill http://localhost:4200/__cypress/runner/cypress_runner.js:1645
_resolveCallback http://localhost:4200/__cypress/runner/cypress_runner.js:1439
_settlePromiseFromHandler http://localhost:4200/__cypress/runner/cypress_runner.js:1531
_settlePromise http://localhost:4200/__cypress/runner/cypress_runner.js:1576
cypress_runner.js:429:195
@Mekacher-Anis Can you provide a reproducible example? Or the exact assertion/custom message that's running? I want to come up with a solution that solves all cases.
I'm not truly sure as to which part of the code is exactly causing the error because when it crashes there's no more cypress UI (just white), no more logs in devtools, and also commenting out parts of the test code to find the culprit isn't that helpful because the crash happens lagging behind i.e. after 400, 300 ms of actual assertions but an educated guess is this part of the test case is the culprit
cy.get('image-cropper img')
.should('have.attr', 'src')
.should('not.eq', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=');
and I'm setting a rather large image as base64 in image-cropper
Yah, it likely is the base64 image in the assertion message, that's what I'm finding with the plugin also. It's just very long assertions that are a problem.
I can recreate with the following code, which is a much simpler example. Just throw an image in fixtures and write this assertion (must be a failing assertion).
it('test', () => {
cy.fixture('crows.jpg').then((img) => {
// img will be encoded as base64
expect(img).to.eq(img + 'a')
})
})
Released in 13.8.0
.
This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v13.8.0, please open a new issue.
Current behavior
I'm using the plugin cypress-plugin-visual-regression-diff in the latest version v3.3.10. I have multiple visual regression tests comparing screenshots of the page with baseline images.
When looking into the debug logs, you can see the test output of the image comparison, but it is not picked up by cypress.
This happens
Desired behavior
When the screenshot does not match the baseline image, the test should just fail (as it did with Cypress 13.7.2 and lower).
Test code to reproduce
Please see https://github.com/tom-mi/cypress-visual-testing-error-demo There you will also find screenshots.
Cypress Version
13.7.3
Node version
v18.18.0
Operating System
ArchLinux
Debug Logs
Other
No response