Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running test suite with empty spec files #15512

Labels
type: regression A bug that didn't appear until a specific Cy version release v6.7.0 🐛 Issue present since 6.7.0

Comments

@nicholaschiang
Copy link

Current behavior

I upgraded to Cypress 6.7.1 and now there's an error when using cypress run with empty spec files:

TypeError: Cannot read property 'tests' of null
    at Object.exports.flattenSuiteIntoRunnables (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/util/tests_utils.js:12:32)
    at ProjectE2E.onTestsReceived [as _recordTests] (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/modes/record.js:727:30)
    at ProjectE2E.<anonymous> (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/project-base.js:280:32)
    at Generator.next (<anonymous>:null:null)
    at /home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/project-base.js:9:71
    at new Promise (<anonymous>:null:null)
    at __awaiter (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/project-base.js:5:12)
    at Object.onTestsReceivedAndMaybeRecord (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/project-base.js:274:63)
    at SocketE2E.<anonymous> (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/socket-base.js:222:32)
    at Generator.next (<anonymous>:null:null)
    at /home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/socket-base.js:8:71
    at new Promise (<anonymous>:null:null)
    at __awaiter (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/socket-base.js:4:12)
    at Socket.<anonymous> (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/server/lib/socket-base.js:221:82)
    at Socket.emit (events.js:315:20)
    at Socket.onevent (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:253:20)
    at Socket._onpacket (/home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:216:22)
    at /home/runner/.cache/Cypress/6.7.1/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/client.js:205:28
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

Desired behavior

There should be no error when running empty spec files. Instead, Cypress should just log a warning that they're empty and move on.

Test code to reproduce

This should be relatively simple to reproduce.:

  1. Just create a new Cypress repo
  2. Add an empty test
  3. And run Cypress

Here's the link to the original repository where I'm seeing the error.

Versions

Cypress: 6.7.1
Browser: N/A

nicholaschiang added a commit to tutorbookapp/tutorbook that referenced this issue Mar 16, 2021
@jennifer-shehane jennifer-shehane added type: regression A bug that didn't appear until a specific Cy version release v6.7.1 🐛 stage: ready for work The issue is reproducible and in scope labels Mar 16, 2021
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Mar 16, 2021

This is a bug introduced in 6.7.0. When running Cypress tests while recording to the Dashboard with an empty specfile, the run will exit with SIGSEGV. This was introduced in #14925

Screen Shot 2021-03-16 at 9 18 42 AM

Workaround

Downgrade to 6.6.0 to record tests with empty spec files.

@github-actions
Copy link
Contributor

Internal Jira issue: TR-713

@clarkd
Copy link

clarkd commented Mar 16, 2021

We are seeing this issue, I think because we use the popular Cypress tags plugin to run different subsets of tests.

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: ready for work The issue is reproducible and in scope labels Mar 16, 2021
@jennifer-shehane
Copy link
Member

@clarkd Could you provide an example of your setup?

@clarkd
Copy link

clarkd commented Mar 17, 2021

Hi @jennifer-shehane - it's a pretty complex so I can't provide a repo but the basic pieces are:

  • Cypress 6.7.1
  • cypress-tags plugin - annaet/cypress-tags
  • Running against Cypress Dashboard with parallelisation
  • Chrome 88 (due to previous issue with v89)

Is there any other info I can provide?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 17, 2021

The code for this is done in cypress-io/cypress#15517, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@thewillhuang
Copy link

We are running into this issue as well. We have commented out tests and this will result in SIGSEGV with 6.7.1 in headless mode. Runs fine tho if you don't do headless

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 17, 2021

Released in 6.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.8.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.