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

Improvements/fixes for reading state.json #2013

Closed
chrisbreiding opened this issue Jun 22, 2018 · 2 comments
Closed

Improvements/fixes for reading state.json #2013

chrisbreiding opened this issue Jun 22, 2018 · 2 comments
Assignees
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Milestone

Comments

@chrisbreiding
Copy link
Contributor

In an attempt to mitigate Cypress randomly hanging in CI, implement the following:

  1. Add debug logs around reading/writing/locking/unlocking files, so if the issue occurs again, they'll hopefully provide more information
  2. Stop the state.json file from being read during run mode. The last log before Cypress hanging is the state.json being read, so it's possible it is the cause. Since we solely persist state related to the GUI/browser in interactive mode, it's not necessary to read it at all during a run. This may solve the issue.
  3. Add a timeout for unlocking a file. If the hanging is indeed caused by the state.json, it's likely it's actually unlocking the file that never resolves. It would be better to time out in this scenario, catch the timeout, and carry on without the file unlocked. There's already a timeout on getting a lock on the file, so subsequent read and writes will handle that accordingly.
  4. Add a whitelist for keys that can be saved in state.json. Currently, it allows any arbitrary keys to be written to it, making it difficult to tell what state it actually can possibly contain. This will document the keys in the code.
@chrisbreiding chrisbreiding added type: enhancement Requested enhancement of existing feature pkg/server This is due to an issue in the packages/server directory labels Jun 22, 2018
@chrisbreiding chrisbreiding added this to the 3.0.2 milestone Jun 22, 2018
@chrisbreiding chrisbreiding self-assigned this Jun 22, 2018
@bahmutov
Copy link
Contributor

bahmutov commented Jun 22, 2018 via email

@brian-mann
Copy link
Member

Released in 3.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants