3000 tests - Major performance issues. What can be done?

Our react project has ~3000 jest tests. Most of them are just typical "render without crashing".

When we run npm test, the amount of memory used slowly climbs all the way to 22 Gb.

On machines with only 16 Gb, the tests grind the entire machine to a halt and take a very long time to finish.

What we have tried that has not worked or made the issue worse:

  1. --maxWorkers=50% or --maxWorkers=4 etc
  2. --runInBand (way too slow)
  3. --detectLeaks (half our tests have memory leaks according to this experimental option, but we have no idea what they are or even if they are the cause of this problem)

The only thing that works is running the tests on a machine with a large amount of RAM (>= 32Gb).

Any idea on how we can reduce the amount of memory used by these tests?



from Recent Questions - Stack Overflow https://ift.tt/3jt0Aq0
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation