question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We need a way to limit to execute tests in a single file concurrently without swamping the CPU

See original GitHub issue

🚀 Feature Proposal

test.concurrent needs some kind or limit to its concurrency to prevent it swamping the CPU. – or – Something like test.farm which feeds the tests into a worker farm rather than immediately executing them.

Motivation

I use puppeteer with jest-image-snapshot to perform visual regression testing. I use globby to gather a list of output html files and feed them into test(), I’d like to feed them into test.concurrent() but that then tries to open 200 tabs at the same time then things go wrong very quickly.

Example

I’m thinking this should probably be the default operation of the feature, much like the maxWorkers option. If people are confident their code will behave fully concurrently then perhaps expose a maxConcurrentWorkers option. – or – test.farm(‘test name’, async() => { // Some big horrible test });

Pitch

test.concurrent is a core feature, it makes sense for it to be addressed here.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dangreenisraelcommented, Aug 13, 2019

In case someone comes across this looking to limit concurrency: https://jestjs.io/docs/en/cli#maxconcurrency-num

1reaction
kevlenedcommented, Sep 15, 2018

If you’re willing to split your test.concurrent into different files, I wrote a concurrent test runner. Instead of the default of running each file in a different process, it runs them concurrently. You can control the concurrency with maxConcurrentTests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kernel/Reference/stress-ng - Ubuntu Wiki
The matrix stressor is a good way to exercise the CPU floating point operations as well as memory and processor data cache. Of...
Read more >
Speed Up Your Python Program With Concurrency
These are the CPU-bound programs, because the resource limiting the speed of your program is the CPU, not the network or the file...
Read more >
1. fio - Flexible I/O tester rev. 3.32 - FIO's documentation!
It will need to be split into valid sets of json after the run. Only run specified section name in job file. Multiple...
Read more >
How many threads can I run concurrently? - Stack Overflow
It depends on hardware as you're (probably) not using a theoretical computer but a physical hardware one, so you have limited resources.
Read more >
Configuring runners - GitLab Docs
On the details page you should see a row for IP Address. specific runner IP address. Use tags to control which jobs a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found