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

Sidenav: Update wait for animation to be less flaky in test #535

Merged
merged 4 commits into from
May 26, 2023

Conversation

daneah
Copy link
Member

@daneah daneah commented May 26, 2023

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?
  • Component status page up to date?

What does this change address?

Upon reviewing several of the flaky runs of unit tests, the resets its slide status when going back to a viewport above 1055px was the frequent culprit. I suspect this is because the animation doesn't finish after the next frame much of the time, so using aTimeout to wait instead might be more robust. We use aTimeout regularly throughout the tests. We can increase the timeout value if we continue to see flakiness out of it.

How does this change work?

Replace await nextFrame() with await aTimeout(1000) in the flaky test.

@daneah daneah requested a review from a team as a code owner May 26, 2023 00:35
@daneah daneah requested review from chrisjbrown, SMQuazi and mtorres3 and removed request for a team May 26, 2023 00:35
@changeset-bot
Copy link

changeset-bot bot commented May 26, 2023

⚠️ No Changeset found

Latest commit: 2d3872d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@daneah daneah changed the title fix(tests): update wait for sidenav animation to be less flaky Sidenav: Update wait for animation to be less flaky in test May 26, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

size-limit report 📦

Path Size
packages/pharos/lib/index.js 46.9 KB (0%)

@daneah
Copy link
Member Author

daneah commented May 26, 2023

I saw failures at each of 1ms and 100ms, but at 1000ms I've run the tests thrice and seen ✅ all the way through.

@daneah daneah merged commit 3188911 into develop May 26, 2023
@daneah daneah deleted the fix/flaky-sidenav-test branch May 26, 2023 14:37
sirrah-tam pushed a commit to sirrah-tam/pharos that referenced this pull request Dec 1, 2023
* fix(tests): update wait for sidenav animation to be less flaky

* fix(test): update timeout to 100ms

* fix(tests): try 1000ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants