I'm running 60 E2E tests with Jest and Puppeteer on an EC2 Jenkins slave. Tests' times ranging between 7-90 seconds, averaged at 24 seconds - meaning total time when running sequentially ~24-25 min.
When running jest -w 10
it runs 10 tests in parallel but every test takes longer and the time is resembles jest --runInBand
both finish at about 24-26 min.
I read this and related links, and so changed the machine I'm running on to r5ad.12xlarge
(48 cores, 384 GB!) because of the assumption of limited resources and still no effect on the total running time. More attempts I made:
- Tried with and without
--ci --detectOpenHandles
, still nothing. NODE_OPTIONS=--max_old_space_size=4096
didn't change it either.- Ran with default, 2, 3, 9, 15... workers.
- Checked heap usage with
node --expose-gc ./node_modules/.bin/jest --runInBand --logHeapUsage
and saw some leak - heap usage gradually increased from ~100MB to 1100MB - Tried running locally on the machine (without Jenkins restrictions on resources if any...)
My question is if I'm missing something (a flag, Jenkins agent policy)? Maybe I should try a different test runner for the purpose of E2E because jest is aimed more at unit testing?