Skip to content

wait* utilities take more time since 9.2.0 (running into Timeout) #379

@kissthom

Description

@kissthom
  • react-testing-library version: 9.2.0
  • react version: 16.9.5
  • node version: 12.6.0
  • yarn version: 1.19.0

Relevant code or config:

What you did:

Upgraded from version 9.1.4 to 9.2.0.

What happened:

Some of our tests which are using the "wait*" utilities provided by the library are running into jest timeout after the upgrade. In some cases waiting for a dom element to appear takes 7-8x times more (~3 seconds) as before with version 9.1.4.

Reproduction:

I've created a simple example to reproduce the problem although with this example the difference is not so critical as in our application.

https://codesandbox.io/s/rtl-wait-slow-g7c21

Steps to reproduce:

  1. Run the tests and check out the results in the console (average time for waiting for select.options elements to appear 40-60ms)
  2. Switch the rtl version to 9.2.0
  3. Run the tests and check out the results again (2-3 times slower) (average time for waiting for select.options elements to appear 110-150ms)

Any help is appreciated.

Problem description:

Suggested solution:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions