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: Revert flaky unit test sleep() hacks #59071

Closed
tyxla opened this issue Feb 15, 2024 · 3 comments · Fixed by #64205
Closed

Components: Revert flaky unit test sleep() hacks #59071

tyxla opened this issue Feb 15, 2024 · 3 comments · Fixed by #64205
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Comments

@tyxla
Copy link
Member

tyxla commented Feb 15, 2024

What problem does this address?

In #59012, #58629, and #58968 we added some sleep() calls before press.Tab() as a patching attempt to make some unit tests less flaky.

What is your proposed solution?

We should fix the underlying cause (likely in @ariakit/test) instead of resolving it with hacks like this. We should also revert the sleep() calls we introduced In #59012, #58629, and #58968.

cc @mirka @Mamaduka

@tyxla tyxla added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Package] Components /packages/components labels Feb 15, 2024
@tyxla tyxla self-assigned this Feb 15, 2024
@tyxla
Copy link
Member Author

tyxla commented Feb 15, 2024

@diegohaz any ideas from the top of your head why tests could be flaky on these rare occasions, and a sleep() before press.Tab() makes them more stable? Is this something that we could have addressed in @ariakit/test instead?

@diegohaz
Copy link
Member

diegohaz commented Feb 15, 2024

All items within an Ariakit composite widget remain tabbable until they are completely processed internally (for example, to determine their order). After that, only the active item stays tabbable. This happens asynchronously after the initial render.

This is to guarantee that all elements are accessible to keyboard users until we can respond to arrow keys.

A potential solution could be to wait for inactive items to become non-tabbable before hitting the Tab key during the test.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 2, 2024
@tyxla
Copy link
Member Author

tyxla commented Aug 2, 2024

Cleaning those up in #64205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants