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

fix: Fix flaky global breadcrumbs test #2676

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

just-boris
Copy link
Member

Description

Replacement for this PR: #2666

Related links, issue #, if available: n/a

How has this been tested?

Build passes

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.

return delay();
await waitFor(() => expect(wrapper.findAppLayout()!.find('[data-awsui-discovered-breadcrumbs="true"]')).toBeTruthy());
Copy link
Member Author

Choose a reason for hiding this comment

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

Main part of the fix. Instead of waiting for an arbitrary time, we wait for a clue from the component that the deduplication happened

Comment on lines +63 to +67
render(<BreadcrumbGroup items={defaultBreadcrumbs} />);
await delay();
Copy link
Member Author

Choose a reason for hiding this comment

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

For the cases where we test no-deduplication mode we keep the delay, because there is no that clue

Copy link
Member

Choose a reason for hiding this comment

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

The test "when multiple nested app layouts rendered, the outer instance receives breadcrumbs" is still flaky.

Copy link
Member

Choose a reason for hiding this comment

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

And also this one: "when multiple breadcrumbs instances are present the latest is applied"

Copy link
Member

Choose a reason for hiding this comment

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

And this: "renders breadcrumbs adjacent to app layout"

Copy link
Member Author

Choose a reason for hiding this comment

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

How do you see that?

Copy link
Member

Choose a reason for hiding this comment

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

Surprisingly, the tests passed in the experiment PR but they consistently failing locally. I have 10-15 failing tests for a single run.

Copy link
Member Author

Choose a reason for hiding this comment

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

Applied the same describe.each multiplier, ran tests a few thousand times locally as well, all passes for me.

Do you consider your local issues merge blocking?

Copy link
Member

Choose a reason for hiding this comment

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

Alright, it is not a blocker for the pr then. I use the same branch and run npm install - the tests do fail consistently for me still.

Copy link
Member

@pan-kot pan-kot Sep 6, 2024

Choose a reason for hiding this comment

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

Did you try this version, right?

I noticed you removed lines like expect(findAllBreadcrumbsInstances()).toHaveLength(1);. All failures I receive locally are due to these.

Copy link
Member

Choose a reason for hiding this comment

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

The latest version with expect(findAllBreadcrumbsInstances()).toHaveLength(1) under waitFor does work for me locally, too.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.78%. Comparing base (78993c6) to head (dd0aec6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2676      +/-   ##
==========================================
- Coverage   95.79%   95.78%   -0.01%     
==========================================
  Files         744      744              
  Lines       20566    20566              
  Branches     7011     6639     -372     
==========================================
- Hits        19702    19700       -2     
- Misses        856      858       +2     
  Partials        8        8              

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

@just-boris just-boris requested a review from pan-kot September 6, 2024 08:53
@just-boris just-boris marked this pull request as ready for review September 6, 2024 08:53
@just-boris just-boris requested a review from a team as a code owner September 6, 2024 08:53
@just-boris just-boris removed the request for review from a team September 6, 2024 08:57
@just-boris just-boris added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit fc71ef8 Sep 6, 2024
33 checks passed
@just-boris just-boris deleted the fix-global-breadcrumb-tests branch September 6, 2024 13:05
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