cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Renderer CoreText warnings displaying when running cypress in Electron

Open mwren-mshanken opened this issue 4 years ago • 24 comments

Current behavior:

During my test run my log started being filled with:

2020-05-06 10:20:09.935 Cypress Helper (Renderer)[13275:1197167] CoreText note: Client requested name ".AppleSymbolsFB", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-05-06 10:20:09.935 Cypress Helper (Renderer)[13275:1197167] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.

Eventually, Cypress crashed between tests, between the Screenshot and Video packaging steps:

(Screenshots)

  -  /Users/morgan/Documents/WineSpectator/git/ws/cypress/screenshots/ws_home_page.sp     (1280x720)
     ec.js/Testing shared resources like header, footer, etc -- Homepage Ads appear -               
     - Banner Ads Appear (failed).png                                                               

The Test Runner unexpectedly exited via a exit event with signal SIGSEGV

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: darwin (19.4.0)
Cypress Version: 4.5.0

Desired behavior:

Cypress executes test runs without crashing

Test code to reproduce

fwiw most of my tests were hitting

winespectator.com -- I had tests running on the home page here.

Versions

Platform: darwin (19.4.0) Cypress Version: 4.5.0

mwren-mshanken avatar May 06 '20 17:05 mwren-mshanken

I can consistently reproduce this with this portion of a test. The first test triggers it, and running additional tests allows enough time for it to manifest. If I run the first test in isolation with an .only it ends before I see the error in the logs

context('Past Years Top 10s', function() {
        beforeEach(function() {
            cy.visit('https://top100.winespectator.com/archives/')
        })

        it('Elements Appear', function() {
            cy.get('.s-archive-item')
            .should('be.visible')
            .and('have.length', 6)
        })        
    })

    context('100 Values', function(){
        beforeEach(function() {
            cy.visit('https://top100.winespectator.com/values/')
        })
        
        it('Map appears, and can be clicked to expand', function() {
            cy.get('.values-map-link')
            .should('be.visible')
            .click()

            cy.get('.featherlight-content')
            .should('be.visible')
            .find('.featherlight-close')
            .click()

            cy.get('.featherlight-content')
            .should('not.be.visible')
        })

        it('Header Buttons serve valid pages', function() {
            cy.get('.values-menu')
            .find('a')
            .each(function(button) {
                cy.validateHref(button)
            })
        })
    })

mwren-mshanken avatar May 06 '20 18:05 mwren-mshanken

Working back, it appears that this was introduced in 4.2.0

mwren-mshanken avatar May 06 '20 19:05 mwren-mshanken

I am able to see the Renderer warnings, but am not able to reproduce the crashing with a SIGSEGV exit. Is the SIGSEGV crash consistent on each run? Because I'm not sure the crash is related to the Renderer warnings.

I can see the warnings started appearing in 4.2.0 when running in Electron. Probably due to the Electron upgrade.

You can run the tests passing --browser chrome. This will launch the tests within a Chrome browser detected on your machine without the error.

jennifer-shehane avatar May 07 '20 09:05 jennifer-shehane

I think this may have something to do with the app under test using -apple-system font in css, but I haven't been able to recreate it outside of their app.

jennifer-shehane avatar May 07 '20 10:05 jennifer-shehane

The crash for me occurs later in the test run. As I continue to run more tests this error spams my log. It may be triggering some sort of leak. After a minute or so the process crashes.

mwren-mshanken avatar May 07 '20 16:05 mwren-mshanken

I encountered the same problem!

cw010 avatar May 25 '20 02:05 cw010

The CoreText warnings started appearing on a fresh install (4.7.0) on the base todo mvc app. It does not have -apple-system font in the css.

As mentioned it is only happening on electron (cypress run) and goes away with chrome (cypress run --browser chrome --headless) :rose:

basarat avatar Jun 04 '20 04:06 basarat

For full verification I ran Array.from(document.querySelectorAll('*')).map(n => getComputedStyle(n)).map(style => style.fontFamily).filter(fam => fam.includes('-apple'));

It does exist on page: https://top100.winespectator.com/archives/

image

But it doesn't exist in the app I am testing (which still gives the error when run on electron):

image

basarat avatar Jun 04 '20 04:06 basarat

This is not fixed in the upcoming Electron 9 upgrade.

jennifer-shehane avatar Jun 29 '20 07:06 jennifer-shehane

Reproducible example:

it('Map appears, and can be clicked to expand', () => {
  cy.visit('https://top100.winespectator.com/values/')
  cy.get('.values-map-link')
    .should('be.visible')
    .click()
})

jennifer-shehane avatar Jul 09 '20 08:07 jennifer-shehane

This is not fixed in Electron 10 upgrade, Cypress 5.5.0

jennifer-shehane avatar Oct 28 '20 06:10 jennifer-shehane

FYI, the issue on our side was caused by using cli-spinners. The characters used in those ASCII-art spinners resulted in the "CoreText note" console error messages. By avoiding the use of these characters (in our case, we switched to a css spinner), we avoided ... whatever underlying bug causes these spurious console error messages.

starpit avatar Nov 12 '20 21:11 starpit

FWIW, this issue has affected nearly every application I test with Cypress, often triggered by a deeply-nested dependency that I don't have direct control over. Would be really great to be able to suppress these, as our test output is not very useful (getting thousands of these warnings printed per test run)

searls avatar Dec 17 '20 15:12 searls

FWIW - Same issue using [email protected] - each test suite fires off 10-20 of these:

2021-01-29 10:59:24.986 Cypress Helper (Renderer)[71257:1176057] CoreText note: Client requested name ".AppleSymbolsFB", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

It renders just above the XML terminal output.

As suggested by @starpit, I checked our node_modules dir for that deep dependency of cli-spinners, but we don't have that.

EightArmCode avatar Jan 29 '21 11:01 EightArmCode

You don't need cli-spinners a single or similar character is enough, in my case it was loaded via CSS.

thisconnect avatar Jan 29 '21 13:01 thisconnect

Any status update regarding this topic? it's making the CLI output just useless with all the noise coming from this message

nitzanashi avatar Feb 25 '21 09:02 nitzanashi

This is not fixed in latest Electron (13.0.0-beta.7) either.

beorn avatar Mar 27 '21 23:03 beorn

I confirm the issue exists in Cypress 7.4.0 when running in headless mode with cypress run --headless --record false command

sunpietro avatar May 26 '21 12:05 sunpietro

Still experiencing this in Cypress 8.3.0

The way I worked around it was by setting a custom userAgent value in cypress.json. Then, I had the application server check for that user agent (and also that the application wasn't running in production mode) and skip emitting those characters if so. This worked in my case, because the characters were purely decorative (emoji and other multibyte characters in the display text of a <select />), and I had full control of their output.

markjaquith avatar Aug 23 '21 20:08 markjaquith

I'm still experiencing this in 9.5.4

It doesn't affect tests, but it makes the console output so much harder to parse.

astraljames avatar Apr 14 '22 15:04 astraljames

Until this is fixed, I'm piping my CI output through grep to strip the spam:

npm test 2>&1| grep -v 'CoreText note:'

p120ph37 avatar May 18 '22 12:05 p120ph37

This is still present in 12.11.0. Similar to others, the tests run, but the output is near impossible to read. Any useful information is pushed outside of the scroll buffer.

chrisk-7777 avatar May 06 '23 15:05 chrisk-7777

the issue still exists. Cypress: 12.13..0 Electron: V106

natalyayyad avatar Jun 13 '23 10:06 natalyayyad

I'm not able to recreate this behavior with this example in 12.13.0. Is this still hapenning?

jennifer-shehane avatar May 01 '24 17:05 jennifer-shehane