-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix camera_input flaky test (hopefully) #5714
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
Merged
kajarenc
merged 3 commits into
streamlit:develop
from
kajarenc:camera-input-flaky-test-fix
Nov 24, 2022
Merged
Fix camera_input flaky test (hopefully) #5714
kajarenc
merged 3 commits into
streamlit:develop
from
kajarenc:camera-input-flaky-test-fix
Nov 24, 2022
+6
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mayagbarnes
reviewed
Nov 17, 2022
e2e/specs/st_camera_input.spec.js
Outdated
|
|
||
| // Add timeout until image is displayed | ||
| cy.get("img", { timeout: 10000 }).should("have.length.at.least", 2); | ||
| cy.get("img", { timeout: 1000 }).should("have.length.at.least", 2); |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of reducing this custom timeout, I would suggest removing it altogether - along with the comment on line above - since the default Cypress timeout is 4000 milliseconds anyways (doc)
cy.get("img").should("have.length.at.least", 2);
mayagbarnes
approved these changes
Nov 18, 2022
Collaborator
Collaborator
|
@kajarenc you should be good to integrate latest develop & merge 👍🏼 |
tconkling
added a commit
to tconkling/streamlit
that referenced
this pull request
Nov 28, 2022
* develop: Improve error message when widgets of different types have the same key (streamlit#5748) Add a new make target to only install build dependencies (streamlit#5755) Fix camera_input flaky test (hopefully) (streamlit#5714) Fix py_snowflake job for Nightly Release (streamlit#5751)
kmcgrady
pushed a commit
that referenced
this pull request
Nov 30, 2022
* Fix camera_input flaky test (hopefully)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📚 Context
These changes should hopefully fix test flakiness for the camera_input e2e test.
The reason, why flakiness was happening, is because
Take photois active even when the video stream from the browser is not ready yet.Unfortunately, the
react-webcamlibrary is not capable to provide us readiness event, theonUserMediaevent is fired at the point when the browser had allowed to get video stream (for example when a user clickedAllowfor the camera permission prompt), but actual video stream starts work after some period of time. So waiting 1 second before clickingTake photobutton should be enough.What kind of change does this PR introduce?
🧠 Description of Changes
Add bullet points summarizing your changes here
Revised:
Insert screenshot of your updated UI/code here
Current:
Insert screenshot of existing UI/code here
🧪 Testing Done
🌐 References
Does this depend on other work, documents, or tickets?
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.