Closed PetMou closed 4 years ago
@PetMou I am also facing the same issue on Windows 10 any luck finding solution
@PetMou Can you provide a small repo where when run where this is happening in Windows 10? Thanks.
Hereby the minimal scenario that shows the issue. I hope this is enough? cypress_5995.zip
These 'undefined' lines do not show up in our (Linux) pipeline, nor in a headed run. We use Windows 10 Enterprise in a HyperV environment. cypress.json:
{
"chromeWebSecurity": false,
"video": false,
"integrationFolder": "cypress/integration"
}
I'm experiencing this same issue in our Windows Server 2016 Standard environment in a headless run with 3.8.0 and 3.8.1
Seeing the same thing with 3.8.2 - this doesn't happen with 3.7.0.
To reproduce in an empty folder:
npm init -y
npm install cypress --save-dev
npx cypress open
npx cypress run
I was able to track this down in our own Appveyor runs on Windows of our kitchen-sink.
Appveyor build: https://ci.appveyor.com/project/cypress-io/cypress-example-kitchensink/builds/29572107
Appveyor build: https://ci.appveyor.com/project/cypress-io/cypress-example-kitchensink/builds/29572107
Is this reproducible when running cypress run --browser chrome
?
I've been looking through the PRs in 3.8.0, there are some that touch the run.js
file that issues the output here, but I don't see anything that should have affected the output.
--headless
chrome: https://github.com/cypress-io/cypress/pull/5676--tag
flag: https://github.com/cypress-io/cypress/pull/5164There is also this Windows specific PR that went into 3.8.0 https://github.com/cypress-io/cypress/pull/5853
Is this reproducible when running
cypress run --browser chrome
?
Yes
Same behaviour on v4.0.1
This is due to how console.log
works in electron on windows: (lib/browser/init.ts:18)
// Redirect node's console to use our own implementations, since node can not
// handle console output when running as GUI program.
const consoleLog = (format: any, ...args: any[]) => {
return process.log(util.format(format, ...args) + '\n')
}
Which means that every time that mocha wants to output an empty row, through console.log()
, this happens:
let consoleLog = (format, ...args) => util.format(format, ...args);
consoleLog(); // 'undefined'
The change in electron happened here: https://github.com/electron/electron/pull/16441/files#diff-fd84dda09f0dbd7e74e2822ff6cf19a8R27 But I have not figured out what version that was released in.
nice @piksel - thanks for this. Is there an issue in Electron repo for this behavior by any chance? @flotwig can we stub console.log()
and call console.log('')
to get around this?
I haven't been able to find any issues for it in electron. I'll make one.
The temporary fix I did was to put this in server/index.js
:
const consoleLog = console.log;
console.log = (...args) => consoleLog(...(args.length<1?['']:args));
I hope this doesn't alter the root cause found by @piksel, but the issue also appears when running with headless chrome options...
No, it still applies. Regardless of what browser you are using, the "orchestrator" is always Cypress.exe (or the OS binary equivalent) which is a branded electron binary.
On Mon, 10 Feb 2020 at 13:47, PetMou notifications@github.com wrote:
I hope this doesn't alter the root cause found by @piksel https://github.com/piksel, but the issue also appears when running with headless chrome options...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cypress-io/cypress/issues/5995?email_source=notifications&email_token=AAGFDVZYSH4G456K5642IYDRCFEFNA5CNFSM4J4IBVHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELIL6OA#issuecomment-584105784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGFDV7MQ7MEUPV5GWJGJPLRCFEFNANCNFSM4J4IBVHA .
Fixed in 4.1.0 ! Closing the issue
This was fixed because Electron was bumped from 7.1.10 to 7.1.13 in Cypress 4.1.0, and this bug was fixed in 7.1.13: https://github.com/electron/electron/pull/22173
This issue will be closed to further comment as the exact issue here was resolved and tested.
If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.
When I do a 'cypress run' (windows 10 environment), I get several lines with text 'undefined' in the report. To exclude any local influences, I made a dummy scenario which does absolutely nothing, with a minimal 'cypress.json' file. But still it reports these lines.
All tests pass, so it is not blocking. It's just puzzling. Running in debug mode gives no clues as to what is undefined: