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

fix: use app.whenReady and remove delay race for electron startup #15075

Merged
merged 5 commits into from Feb 15, 2021

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Feb 12, 2021

This change fixes an issue that caused the startup to be delayed by 500ms.
We used app.on('ready') without checking app.isReady(), however the
'ready' event may already have fired at this point and thus we never
resolved the Promise waiting for it.
Using app.whenReady fixes this and now that Promise resolves before
the delay expires.

Related links:

https://www.electronjs.org/docs/api/app#event-ready
https://www.electronjs.org/docs/api/app#appwhenready

  • Closes

User facing changelog

  • Improved the startup time of cypress open and cypress run.

Additional details

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

thlorenz and others added 2 commits February 12, 2021 10:11
This change fixes an issue that caused the startup to be delayed by 500ms.
We used `app.on('ready')` without checking `app.isReady()`, however the
'ready' event may already have fired at this point and thus we never
resolved the Promise waiting for it.
Using `app.whenReady` fixes this and now that Promise resolves before
the delay expires.

Related links:

https://www.electronjs.org/docs/api/app#event-ready
https://www.electronjs.org/docs/api/app#appwhenready
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 12, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Feb 12, 2021

CLA assistant check
All committers have signed the CLA.

@cypress
Copy link

cypress bot commented Feb 12, 2021



Test summary

9314 0 118 3Flakiness 1


Run details

Project cypress
Status Passed
Commit 7d66091
Started Feb 12, 2021 4:10 PM
Ended Feb 12, 2021 4:21 PM
Duration 10:57 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

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

@flotwig flotwig changed the title fix: use app.whenReady and remove delay race for cypress open fix: use app.whenReady and remove delay race for cypress open/cypress run Feb 12, 2021
@flotwig flotwig marked this pull request as ready for review February 12, 2021 16:46
@flotwig flotwig changed the title fix: use app.whenReady and remove delay race for cypress open/cypress run fix: use app.whenReady and remove delay race for electron startup Feb 12, 2021
Copy link
Contributor

@bahmutov bahmutov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local Cypress still works, and CI tests pass, nice

@bahmutov bahmutov merged commit 10fdd7b into develop Feb 15, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 16, 2021

Released in 6.5.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 16, 2021
@flotwig flotwig deleted the fix-electron-startup-delay branch January 24, 2022 18:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants