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

Components: Try fixing some flaky Composite and Tabs tests #58968

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Feb 13, 2024

What?

This PR adds some flexibility to a few Composite and Tabs tests.

Why?

To reduce the test flakiness.

How?

We're adding some wait time before checking focus right after tabbing.

Testing Instructions

Verify all tests pass.

Testing Instructions for Keyboard

None

Screenshots or screencast

None

@tyxla tyxla added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Feb 13, 2024
@tyxla tyxla self-assigned this Feb 13, 2024
Copy link

github-actions bot commented Feb 13, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: tyxla <[email protected]>
Co-authored-by: mirka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@@ -275,7 +275,7 @@ describe.each( [
const { item2 } = getOneDimensionalItems();

await press.Tab();
expect( item2 ).toHaveFocus();
await waitFor( () => expect( item2 ).toHaveFocus() );
Copy link
Member Author

@tyxla tyxla Feb 13, 2024

Choose a reason for hiding this comment

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

Perhaps some sleep() before the Tab() (as suggested here) would be a good improvement too?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that might help. The Tabs test was fine, but I could still get this Composite one to flake.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 1eb47f2

@@ -275,7 +275,7 @@ describe.each( [
const { item2 } = getOneDimensionalItems();

await press.Tab();
expect( item2 ).toHaveFocus();
await waitFor( () => expect( item2 ).toHaveFocus() );
Copy link
Member

Choose a reason for hiding this comment

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

Yes, that might help. The Tabs test was fine, but I could still get this Composite one to flake.

@tyxla tyxla force-pushed the try/fix-flaky-composite-tabs-tests branch from e3176eb to 1eb47f2 Compare February 14, 2024 11:42
Copy link

github-actions bot commented Feb 14, 2024

Flaky tests detected in 1eb47f2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7900653318
📝 Reported issues:

@tyxla tyxla merged commit 61aa8f5 into trunk Feb 14, 2024
58 checks passed
@tyxla tyxla deleted the try/fix-flaky-composite-tabs-tests branch February 14, 2024 12:23
@github-actions github-actions bot added this to the Gutenberg 17.8 milestone Feb 14, 2024
@tyxla
Copy link
Member Author

tyxla commented Feb 14, 2024

Another flaky test failure on trunk occurred just when I landed this one, so I opened #59012.

@creativecoder creativecoder added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. and removed [Type] Enhancement A suggestion for improvement. labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants