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: call screencastOpts as a function for starting a screencast on electron. #23001

Merged
merged 3 commits into from
Jul 29, 2022

Conversation

mjhenkes
Copy link
Member

User facing changelog

Fixes a hang when sending video to the dashboard from the electron browser.

Additional details

This issue was introduced in version 8.6.0 with this change: #18392

screencastOpts was converted to a function, but not all instances were called as a function. In the electron browser we passed the function as the options object, which ended up causing a hang when running test.

Based on my testing I'm confident in this fix, but I'm looking for suggestions about how to write a test for it.

I've also added an additional debug log to for future debugging to see if we allow the browser to hang when recording.

Steps to test

This has been tested via CI. A user was kind enough to help me get a re-creatable example setup for me to test against. Using that I was able to recreate the hang and discover the offending commit.

The hang was introduced in build 107 (which uses cypress built from this commit: b4b3d67 ) and corrected in build 109 (which uses cypress build from this commit: 3f7fc20). 108 was additional logging.

https://app.circleci.com/pipelines/github/mjhenkes/jcontent?branch=master

How has the user experience changed?

This specific hang will no longer occur in CI.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@mjhenkes mjhenkes requested a review from a team as a code owner July 28, 2022 21:35
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 28, 2022

Thanks for taking the time to open a PR!

Co-authored-by: Mark Noonan <mark@cypress.io>
@cypress
Copy link

cypress bot commented Jul 28, 2022



Test summary

37837 0 456 0Flakiness 10


Run details

Project cypress
Status Passed
Commit 68bb26a
Started Jul 29, 2022 1:03 PM
Ended Jul 29, 2022 1:23 PM
Duration 20:22 💡
OS Linux Debian - 11.3
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/xhr.cy.js Flakiness
1 ... > logs request + response headers
2 ... > logs Method, Status, URL, and XHR
3 ... > logs response
4 ... > logs response
cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged first
This comment includes only the first 5 flaky tests. See all 10 flaky tests in the Cypress Dashboard.

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

@@ -784,6 +784,8 @@ const createRunAndRecordSpecs = (options = {}) => {
})

if (response === responseDidFail) {
debug('`responseDidFail` equals `response`, allowing browser to hang until it is killed: Response %o', { responseDidFail })
Copy link
Member

Choose a reason for hiding this comment

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

why not just kill the process?

Copy link
Member Author

Choose a reason for hiding this comment

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

This seems like the safest (easiest) option. I don't have context for why this was setup this way, but now we will have logs when/ if it happens.

@emilyrohrbough emilyrohrbough merged commit f147ebb into develop Jul 29, 2022
@emilyrohrbough emilyrohrbough deleted the matth/fix/issue-17627-hang-fix branch July 29, 2022 13:27
htekdev pushed a commit to htekdev/cypress that referenced this pull request Aug 13, 2022
@htekdev
Copy link

htekdev commented Aug 15, 2022

Hello @mjhenkes my organization is currently not in the position to upgrade to 10 from 9. What can we do to add a patch for 9? I actually created a fork but not sure what to do next when it comes to patches
#23330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress hung up trying to run a spec - won't resolve
6 participants