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.
Running: dummy.spec.js (1 of 1)
undefined
dummy describe
โ dummy it (85ms)
undefined
undefined
1 passing (96ms)
undefined
(Results)
All tests pass, so it is not blocking. It's just puzzling.
Running in debug mode gives no clues as to _what_ is undefined:
```
2019-12-18T09:00:40.155Z cypress:server:project onMocha pass
2019-12-18T09:00:40.155Z cypress:server:reporter got mocha event 'pass' with args: [ { id: 'r3', title: 'dummy it', state: 'passed', body: 'function () {// nothing happens\n }', type: 'test', duration: 15, wallClockStartedAt: '2019-12-18T09:00:40.145Z', timings: { lifecycle: 14, test: [Object] } } ]
โ dummy it
2019-12-18T09:00:40.155Z cypress:server:project onMocha test end
2019-12-18T09:00:40.155Z cypress:server:reporter got mocha event 'test end' with args: [ { id: 'r3', title: 'dummy it', state: 'passed', body: 'function () {// nothing happens\n }', type: 'test', duration: 15, wallClockStartedAt: '2019-12-18T09:00:40.145Z', timings: { lifecycle: 14, test: [Object] } } ]
2019-12-18T09:00:40.169Z cypress:server:project onMocha test:after:run
2019-12-18T09:00:40.169Z cypress:server:reporter got mocha event 'test:after:run' with args: [ { id: 'r3', title: 'dummy it', state: 'passed', body: 'function () {// nothing happens\n }', type: 'test', duration: 15, wallClockStartedAt: '2019-12-18T09:00:40.145Z', wallClockDuration: 19, timings: { lifecycle: 14, test: [Object] } } ]
2019-12-18T09:00:40.170Z cypress:server:project onMocha suite end
2019-12-18T09:00:40.170Z cypress:server:reporter got mocha event 'suite end' with args: [ { id: 'r2', title: 'dummy describe', root: false, type: 'suite' } ]
undefined
2019-12-18T09:00:40.171Z cypress:server:project onMocha suite end
2019-12-18T09:00:40.171Z cypress:server:reporter got mocha event 'suite end' with args: [ { id: 'r1', title: '', root: true, type: 'suite' } ]
2019-12-18T09:00:40.171Z cypress:server:project onMocha end
2019-12-18T09:00:40.171Z cypress:server:reporter got mocha event 'end' with args: [ { end: '2019-12-18T09:00:40.167Z' } ]
undefined
1 passing (38ms)
undefined
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Tests: 1 โ
โ Passing: 1 โ
โ Failing: 0 โ
โ Pending: 0 โ
โ Skipped: 0 โ
โ Screenshots: 0 โ
โ Video: true โ
โ Duration: 0 seconds โ
โ Spec Ran: dummy.spec.js โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2019-12-18T09:00:41.178Z cypress:server:run attempting to close the browser
>
@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.