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
fix(server): close Firefox completely between specs on Windows #7106
fix(server): close Firefox completely between specs on Windows #7106
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
Hi, we're changing our contributing workflow to use Draft PRs instead of Please mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR. |
@suryart does this only apply on win32, confirmed? it seems that users are having similar issues on macOS and linux, although not everyone 🤔 |
ah, i get it, this only happens on windows because we have to use cmd.exe to spawn firefox, and firefox immediately detaches itself from cmd.exe which leads to |
Sorry for the delayed response. I see in the other comment that you've figured it's happening only on Windows(win32). The PR mentioned seems like the right approach to me. So, please feel free to close this PR if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Thank you for the reviews. I will update code according to the changes requested in a few weeks. |
@suryart I'll try to finish this up today, so we can get the fix out with the release next week |
32b6b9c
to
69195c2
Compare
69195c2
to
7567d97
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
|
||
let parentPidFile = browserInstance.spawnargs[browserInstance.spawnargs.length - 1].split('\\') | ||
let parentPidWithFilename = parentPidFile[parentPidFile.length - 1].split('-') | ||
let parentPid = parentPidWithFilename[parentPidWithFilename.length - 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the pid here is actually the pid of the Cypress Electron process, which we don't want to kill
Any luck with the changes done and the approach you have taken? I have also tried various ways of killing firefox instance but getting the same error as you mentioned in the above comment. |
@bhaskerchari not yet, for now you could probably disable video recording ( |
@flotwig , Sorry just curious how does it work by disabling video recording ( |
@bhaskerchari I was able to work around the ECONNRESET error by handling foxdriver errors here: 111e09b |
@flotwig , Thank you for the update but any idea on when the fix may be released into the latest cypress version? |
Hopefully within the next release. |
@bahmutov now that cypress-io/cypress-example-kitchensink#436 is opened, can this be approved? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can work, let's merge it into develop
to test against Kitchensink via
- npm run test-if -- --repo cypress-example-kitchensink --command test:ci:record:windows:firefox
Firefox is spawned differently than chrome. For Firefox, the
.kill()
does not actually close the instance running with the current profile from the arguments. It spawns a parent and a child process and runs the spec in the child process instance, while.kill()
kills the child process, it leaves the parent process running, leading the next run to conflict with another spawned process(which fails for obvious reason) for the next spec execution.Error: cannot open socket
displayed at beginning of running spec #6392User facing changelog
cypress run
on Windows could fail.Additional details
Bug fix: Video recording fails as Firefox instance not closing at the end of the spec on Windows.
Bug fix: Failing to start new spec with Firefox as previous Firefox instance not closing at the end of the spec on Windows.
How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?