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(tests): Try to reduce Cypress flakiness by tracing JSON parsing errors #505

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

adrienjoly
Copy link
Member

@adrienjoly adrienjoly commented Dec 10, 2021

@adrienjoly adrienjoly self-assigned this Dec 10, 2021
@adrienjoly adrienjoly added the bug label Dec 10, 2021
@cypress
Copy link

cypress bot commented Dec 10, 2021



Test summary

21 0 1 0


Run details

Project Openwhyd
Status Passed
Commit fc3df1d ℹ️
Started Dec 10, 2021 5:09 PM
Ended Dec 10, 2021 5:12 PM
Duration 02:32 💡
OS Linux Ubuntu - 20.04
Browser Chromium 96

View run in 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

@adrienjoly adrienjoly merged commit e23528f into master Dec 10, 2021
@adrienjoly adrienjoly deleted the fix/cypress-flaky-jquery-json-parsing branch December 10, 2021 17:14
adrienjoly added a commit that referenced this pull request Dec 26, 2021
)

## Problem

Despite several attempts to improve the situation (see PRs #501, #504, #505, #507, #508, #510, #513, #520, #521, #522), Cypress tests are still flaky: they timeout for random reasons.

## Hypothesis

This timeout could be caused by the fact that:
- some XHR requests (e.g. to `/api/notif` to fetch notifications, and Deezer) may never respond => `onLoad` is never triggered
- when a new test starts, we call `/testing/reset` to refresh the DB, which can cause pending DB queries from never resolving

See #520 (comment).

## Proposed solution

- wait for Openwhyd server to be up and reset before running tests
- intercept and mock flaky XHR requests
- fail faster when test steps are hanging for too long
- reduce the amount of resources to load: fonts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant