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

cy.writeFile Does Timeout #3350

Open
SDESkowronski opened this Issue Feb 6, 2019 · 2 comments

Comments

2 participants
@SDESkowronski
Copy link

SDESkowronski commented Feb 6, 2019

Current behavior:

The documentation says it is technically possible for cy.writeFile to timeout but it shouldn't, however, it did for me today. I know it was the cy.writeFile that timedout because it is the only cy.Command in my aftereach hook.

The Error Output:

  20) EditAndBranching
       "after each" hook for "Tag And Frog":
     Error: Cypress command timeout of '4000ms' exceeded.

Because this error occurred during a 'after each' hook we are skipping all of the remaining tests.
      at http://localhost:5050/__cypress/runner/cypress_runner.js:66264:25

Desired behavior:

I think Cypress should provide a way to override the timeout or fix it so it can't timeout.

I also think Cypress should not stop running the remaining tests when one fails in the aftereach hook. That is a harsh punishment for an intermittent failure. In fact that also is a good case for not failing all tests in the aftereach since one failure does not necessarily mean they all will fail. Perhaps this needs a rethink as well.

Steps to reproduce: (app code and test code)

"Issues without reproducible steps will get closed." -- How am I supposed to give you code to reproduce this? Do I have to write some OS hook to intercept the writeFile command and make it take longer than 4 seconds?

Sorry but I don't have the time to work up some sort of repro steps...this requirement on obvious flaws is an impedance to filing a bug. I've reported the bug, if you all want to just close and do nothing then so be it.

Versions

Cypress package version: 3.0.3
Cypress binary version: 3.0.3
OS Name: Microsoft Windows 10 Enterprise
OS Version: 10.0.17763 Build 17763
Browser: Electron 59 (headless)

@jennifer-shehane

This comment has been minimized.

Copy link
Member

jennifer-shehane commented Feb 7, 2019

Was able to reproduce from code below:

it('writes until timeout', () => {
  cy.writeFile('./fixtures/my-long-file.txt', Cypress._.times(900000, '😈'))
})

screen shot 2019-02-07 at 5 16 04 pm

This write:file event actually seems to run forever:
screen shot 2019-02-07 at 5 11 20 pm

The writeFile code can be found here:

https://github.com/cypress-io/cypress/blob/renovate/develop/packages/driver/src/cy/commands/files.coffee#L66

@SDESkowronski

This comment has been minimized.

Copy link
Author

SDESkowronski commented Feb 7, 2019

Thanks Jennifer, I'm glad you were able to come up with repro steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment