cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.72k stars 3.16k forks source link

E2E configuration hangs forever at 'initializing config' after migration #21920

Closed sync-by-unito[bot] closed 1 year ago

sync-by-unito[bot] commented 2 years ago

Current Behavior

running the migration on todomvc project, when running the first time e2e it hangs there forever until I refresh it

Loom

https://user-images.githubusercontent.com/1271364/171272976-9b2536b2-47fb-423d-b93b-a3381bb7e5b8.mp4

These are the only logs on the terminal

Screen Shot 2022-05-19 at 2 13 44 PM

Maybe related in DEBUG logs

image (15)

this seems to be only happening in the binary

https://cypressio.slack.com/archives/C02MW5QBD4K/p1652987265272569

Reproducible Steps

  1. Migrate this repo: https://github.com/cypress-io/cypress-example-todomvc

┆Issue is synchronized with this Jira Bug by Unito ┆Attachments: image (15).png | image-20220519-194702.png | Screen Shot 2022-05-19 at 2.13.44 PM.png | Screen Shot 2022-05-25 at 1.09.57 PM.png ┆author: Alejandro Estrada ┆epic: Edge Cases ┆friendlyId: UNIFY-1794 ┆priority: Highest ┆sprint: Backlog ┆taskType: Bug

sync-by-unito[bot] commented 2 years ago

➤ Alejandro Estrada commented:

Maybe related based on the logs

image-20220519-194702

sync-by-unito[bot] commented 2 years ago

➤ Mark Noonan commented:

Moving to blocked as I’ve been unable to reproduce this at all, even in the build from May 19 that was used for the last walkthrough.

sync-by-unito[bot] commented 2 years ago

➤ Mark Noonan commented:

From the screenshots, it looks like is line is where the error in the video happened:

https://github.com/cypress-io/cypress/blob/6622f6a9d3fb4d69b606bdfc83d32fc58e03e37f/packages/data-context/src/sources/GitDataSource.ts#L349

Decided to log this and document the typical output of that stdout for git info. To my surprise, even though the actual failure is not present (nothing hangs) I still saw the error logged:

Screen Shot 2022-05-25 at 1 09 57 PM

Confirmed I see this error logged even in the newest binary.

sync-by-unito[bot] commented 2 years ago

➤ Mark Noonan commented:

The error is always logged because the result has no status code, https://github.com/cypress-io/cypress/blob/6622f6a9d3fb4d69b606bdfc83d32fc58e03e37f/packages/data-context/src/sources/GitDataSource.ts#L352 - it is undefined, not 0.

sync-by-unito[bot] commented 2 years ago

➤ Mark Noonan commented:

Hi Muaz Othman just curious what you make of this, the return value for const result = await execa(cmd, { shell: process.env.SHELL || '/bin/bash', cwd: this.#gitBaseDir }) does not appear to have an exitCode , result.exitCode logs as undefined. It does have a code property of 0. This does not seem to be the cause of the issue but wanted to get your thoughts, does the absence of any exit code mean something? We get a full payload of git data.

sync-by-unito[bot] commented 2 years ago

➤ Muaz Othman commented:

This is weird. I can reproduce getting undefined for result.exitCode which looks weird, and the typing bundled with execa doesn't declare a code field. I found that execa is now at version 6.1.0 and we’re using a 4 years old v 1.0.0. I think we’re using execa to address a few issues with nativechild_process on Windows. I guess we can consider:

Which way do you think we should do it, Mark Noonan and Tim Griesser ?

marktnoonan commented 2 years ago

@rockhold @baus I think we should go on and close this ticket. The error we are seeing that Muaz discusses here is not actually affecting anything (though it would be nice to clean it up) and the main issue reported here could not be reproduced.

steveolotu commented 2 years ago

Not sure if it helps, but just fyi: I had a similar issue and was able to solve it by switching my console from Cmdr to GitBash.

yktoo commented 1 year ago

I'm having the same situation with 12.7 after a fresh install (Cypress was never used in this project). Peek 2023-02-28 15-05

It just hangs forever, no message in DevTools or console.

I'm on Ubuntu 22.10, Node 18.14.2. I use Cypress a lot in other projects without issue.

marktnoonan commented 1 year ago

Thanks, @yktoo it's clearly the same presentation (config just spinning), but seems to be different situation. The issue above is one related to a problem after migrating an existing project from pre-10.0 Cypress, which wouldn't be a factor in a new project.

I've opened a fresh issue (#25974) to track.

zinaemilian commented 1 year ago

Hi, I am installing the first-time cypress on my machine and config spinning over 5 minutes and not lunch Cypress 🤯

zinaemilian commented 1 year ago

image will it be launched at the end?

marktnoonan commented 1 year ago

@zinaemilian what command are you using to open Cypress? Can you share the project?

AndreiMocirean commented 1 year ago

Hello, @marktnoonan I have the same problem. I am running on a MacOS and I have installed Cypress for the first time as I want to learn how to use it. I do open it by ./cypress open command. I tried closing it and now the E2E seems to be configured, but when I do click on it, the following error is generated.

image
marktnoonan commented 1 year ago

Hmm @AndreiMocirean from the screenshot it appears you have opened the./bin folder as a project, which could be causing problems.

Could I suggest the following to explore Cypress:

  1. Make a directory called test-project or something
  2. Inside that directory, run npm install Cypress
  3. Then run npx cypress open

If you follow the setup steps again, Cypress should do its setup and scaffolding in that test-project folder.

zinaemilian commented 1 year ago

I solve this problem with run this command “cypress open --e2e” after installing cypress, I didn't launch with “npx cypress open --config-file cypress/cypress.json” thx a lot

zinaemilian commented 1 year ago

In my case “npm cypress open” did not work. I used the command “npx cypress open --config-file cypress/cypress.json” instead of it. But I faced the spinning issue then I delete and create again my demo-project than I run ““cypress open --e2e” after finishing the installation and it is working as we expected. Many thanks for your quick response @marktnoonan

dplong commented 6 months ago

I'm also getting the spinning "cy" on the "Initializing config..." screen after running ./node_modules/.bin/cypress open then selecting E2E Testing. Cypress v13.6.6 and Rocky 9.3. Haven't tried any of the fixes/workarounds yet.

mikegwhit commented 2 weeks ago

also getting this nothing local changed at all seemed to just happen between my last run EoD yesterday and this a.m. tried:

in my / our case it was a preflight test that was failing and not logging that it was failing (our API server inaccessible)

marktnoonan commented 2 weeks ago

@mikegwhit Thanks for reporting - I'd suggest opening a brand new issue and describe in detail what you're experiencing. This issue was related to a specific problem that used to occur after automated migration of projects from earlier versions of Cypress into Cypress 10 and was since solved. Even if the presentation is the same (stuck on "initializing config...") - if you weren't migrating an old project, then you have a different issue that could be investigated on its own.