Cypress: navigator.setAppBadge hangs Cypress on Chrome 83

Created on 9 Apr 2020  路  7Comments  路  Source: cypress-io/cypress

Current behavior:

Cypress hangs (freezes), indefinitely. CI/CD killed the process after one hour.

This is reproducable - occurs every test run, both in Gitlab CI / Docker, as well as locally.

headless-mode has these issues, headed-mode does not have issues.

Desired behavior:

Cypress finished running (don't care about pass/fail, just that it exists).

Test code to reproduce

reproduce.html

<!doctype html>
<html lang="en">
<head></head>
<body>
<script>
// Note that if you uncomment this line, everything's back to normal:
navigator.setAppBadge(5)
// This related function also causes the issue: 
// navigator.clearAppBadge()
// Here's some (unrelated) context: https://web.dev/badging-api/

document.getElementsByTagName('body')[0].innerText = 'Done'
</script>
</body>
</html>

test_spec.js

describe('Badge Icon', () => {
  it('does not hang cypress', () => {
    cy.visit('./cypress/fixtures/reproduce.html')
    cy.contains('Done')
  })
})

Versions

Cypress: confirmed on 4.3.0 / 4.0.0 / 3.8.3 / 3.8.1, and prior to 3.8.1 this there was no headless mode for Chrome
(assuming that it is the case for all Cypress versions)
OS: Linux
Browser: 
- Chrome 83 has this issue
- Chrome 81 does not have this issue (it passes)
- Electron 80 does not have this issue (it fails because undefined, but that's OK and to be expected)
- Firefox 74 does not have this issue (it fails because undefined, but that's OK and to be expected)
- Firefox 75 does not have this issue (it fails because undefined, but that's OK and to be expected)

Related issues

6449 has similar symptoms, but a different browser.

chrome awaiting external fix

All 7 comments

Hi,
I also got the same issue in Cypress 4.0.2, 4.1.0 and 4.2.0 and with Chrome 80 as browser.
Cypress freeze after 1 or 2 tests and does not respond anymore.
When I run it in headed mode, I saw that there is a blank page.

@fifteen-berry is your issue related to navigator.setAppBadge?

If not, and if you can narrow it down a little bit (removing lines of code, seeing at which point in the test it hangs, having a reproducable example) - feel free to open up a new issue

@EtienneBruines , Yes it's not link to this specfic case, it's more general I think. I will open a new issue

Chrome 80 - navigator.setAppBadge() is not supported (available by default in Chrome 81):

Screen Shot 2020-04-10 at 11 51 41 AM

Canary 84 during cypress open works

Screen Shot 2020-04-10 at 11 52 41 AM

cypress run --headless --browser chrome:canary (Canary 84)

Hangs forever. @EtienneBruines In the future, try print DEBUG logs, sometimes it will show the source of handing. DEBUG logs show this message:

  cypress:launcher chrome stderr: [0410/115409.486281:ERROR:render_process_host_impl.cc(4990)] Terminating render process for bad Mojo message: Received bad user message: No binder found for interface blink.mojom.BadgeService for the frame/document scope
[0410/115409.486325:ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 123 +2s

Full log:
navigator-crash.log

噩賴賵丿賰賲 丕賱賲亘匕賵賱丞 毓賱賶 丕賷 丨丕賱 賮賷 賲爻丕毓丿丞 丕賱丨賱賵賱 賱賱賲卮丕賰賱 噩賷丿丞 丕乇賷丿 鬲賵囟賷丨 丕賰孬乇

We hit the same issue, unrelated to cypress.

It seems like an upstream chromium issue. I've created https://bugs.chromium.org/p/chromium/issues/detail?id=1090429 to track it.

The chromium issue was now set to Fixed.

I guess that means in one of the upcoming chromium/chrome releases it should work.

Was this page helpful?
0 / 5 - 0 ratings