Skip to content

Wait for enough elements to load in flaky e2e tests#4193

Merged
AnOctopus merged 1 commit intostreamlit:developfrom
AnOctopus:fix/flaky-e2e-get-eq
Dec 17, 2021
Merged

Wait for enough elements to load in flaky e2e tests#4193
AnOctopus merged 1 commit intostreamlit:developfrom
AnOctopus:fix/flaky-e2e-get-eq

Conversation

@AnOctopus
Copy link
Copy Markdown
Contributor

The core problem is described in
https://docs.cypress.io/guides/core-concepts/retry-ability#Only-the-last-command-is-retried

Chaining get and then immediately eq is prone to flakiness, because
if the get call sees some but not enough elements, the eq call will
fail, but only the eq call will be retried, so it'll continue to fail
even when the actual page loads the elements before the eq call times
out. Adding an assertion that there are enough elements ensures that the
initial query will be retried until enough elements are present.

This doesn't change all instances of this pattern in the specs, just the ones that have flaked recently. It also doesn't address possible other causes of flaky tests.

The core problem is described in
https://docs.cypress.io/guides/core-concepts/retry-ability#Only-the-last-command-is-retried

Chaining `get` and then immediately `eq` is prone to flakiness, because
if the get call sees some but not enough elements, the eq call will
fail, but only the eq call will be retried, so it'll continue to fail
even when the actual page loads the elements before the eq call times
out. Adding an assertion that there are enough elements ensures that the
initial query will be retried until enough elements are present.
Copy link
Copy Markdown
Collaborator

@kmcgrady kmcgrady left a comment

Choose a reason for hiding this comment

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

Hoping for less flakiness! Thanks for tackling this!

@AnOctopus AnOctopus merged commit 93dd01f into streamlit:develop Dec 17, 2021
@AnOctopus AnOctopus deleted the fix/flaky-e2e-get-eq branch December 17, 2021 03:16
tconkling added a commit to tconkling/streamlit that referenced this pull request Dec 20, 2021
* develop:
  Update error message for redacted exception (streamlit#4200)
  Release 1.3.0 (streamlit#4192)
  Wait for enough elements to load in flaky e2e tests (streamlit#4193)
  Ignore type errors introduced by mypy 0.920 (streamlit#4191)
  Change st.plotly docstring to fix docs rendering (streamlit#4182)
  Fix recursion error in repr method of report thread (streamlit#4176)
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.

2 participants