Open harshilsharma63 opened 3 years ago
@harshilsharma63 is this still relevant¿?
@harshilsharma63 I guess we can close this, right?
I've noticed flaky tests too where re-running the Cypress test suite will fix it. Most recent time I've noticed this: https://github.com/mattermost/focalboard/runs/6557638969?check_suite_focus=true#step:14:1838
Hi @Pinjasaur, such errors in Cypress test can happen when the element in the DOM was found by Cypress but immediately remounted by React for some reason (change of the key for the sequence for example).
Here is my investigation of the previous flaky behaviour:
I see that the test sometimes fails in CI but I can't reproduce the failure locally even after executing it more than 20 times via the command line
npx cypress run --spec "cypress/integration/cardURLProperty.ts"
My guess is that the following happens:
- click to empty input and enter URL
- pressing
enter
to finish editing and posting request to server- rerendering of
URLProperty
component with link and edit/copy buttons (without waiting any updates from the server)- Cypress finds
Edit
button- update from the server via websocket event
- some big subtree of components is rerendering
- for some reason
URLProperty
is unmounted and mounted again during this process- Cypress tries to perform
click()
on the button that was found before and fails because it is no longer attached to DOMThe main question for me is why the component is unmounted after receiving updates from the server.
Summary: Two webapp tests seem to be flaky-
More details of the failed CI run can be found here -https://github.com/mattermost/focalboard/runs/2952731939?check_suite_focus=true#step:12:139
We need to verify the behaviour and fix the tests.