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

chore: Fixes flakiness in dropdown width test #2883

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Oct 16, 2024

Description

Removing dependency on test page timeout in dropdown width integ tests.

Similar fix: #2882

How has this been tested?

  • Validated by running the test over 100 times in GitHub actions
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.20%. Comparing base (780d6b5) to head (3832a51).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2883    +/-   ##
========================================
  Coverage   96.20%   96.20%            
========================================
  Files         761      761            
  Lines       21445    21445            
  Branches     7340     6943   -397     
========================================
  Hits        20631    20631            
- Misses        761      806    +45     
+ Partials       53        8    -45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

const [loading, setLoading] = useState(asyncLoading);
const onOpen = () => {
if (asyncLoading) {
setLoading(true);
setTimeout(() => setLoading(false), 500);
if (manualServerMock) {
window.__pendingCallbacks.push(() => setLoading(false));
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it be easier to configure a synchronous response or to create an additional page with synchronous data flow instead of introducing these race condition handling?

Copy link
Member Author

Choose a reason for hiding this comment

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

This page seems quite complex and I think it is likely that copying it would result in a lot of duplicated code. The manualServerMock only replaces the timeout with an explicit command to simplify integ tests and eliminate flakiness.

@pan-kot pan-kot added this pull request to the merge queue Oct 16, 2024
Merged via the queue into main with commit d358afd Oct 16, 2024
38 checks passed
@pan-kot pan-kot deleted the fix-flaky-test-dropdown-width branch October 16, 2024 13:08
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