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

Tests involving react table are slow and sometimes flake #637

Closed
david-crespo opened this issue Feb 7, 2022 · 3 comments
Closed

Tests involving react table are slow and sometimes flake #637

david-crespo opened this issue Feb 7, 2022 · 3 comments

Comments

@david-crespo
Copy link
Collaborator

I went down the rabbit hole on this and will add more info here later, but I think we are mostly not doing anything wrong, and basically jsdom is very slow sometimes. Can't repro the issue in browser.

@david-crespo
Copy link
Collaborator Author

david-crespo commented Feb 7, 2022

Justin and I did some profiling and figured out it seemed to come down to querying the DOM by role being very slow. Turns out there is a dom-testing-library PR in progress that claims to speed it up by 2 orders of magnitude, but it hasn't been touched in two weeks. It does seem good, though, and it's nearly approved, so maybe we can wait until this drops to worry about it.

testing-library/dom-testing-library#1086

@david-crespo
Copy link
Collaborator Author

This is more like our real problem: when getByRole takes too long, it takes longer than the waitFor loop interval and so the queue just fills up with a ton of getByRoles.

testing-library/dom-testing-library#820

@david-crespo
Copy link
Collaborator Author

The answer is: don't use findByRole until they fix it. getByRole is ok but be aware it can add 50-100ms to a test.

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

No branches or pull requests

1 participant