nodejs / nodejs/node

Support `concurrency` when `--experimental-test-isolation` is set to `'none'`

Aperta
#55,939 7 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature request never-stale test_runner
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

What is the problem this feature will solve?

It would be nice to be able to run multiple "workers" when using the none test isolation mode.

Today, according to the docs, when --experimental-test-isolation is set to 'none', it implies 1 concurrency: https://github.com/nodejs/node/blob/f270462c09ddfd770291a7c8a2cd204b2c63d730/doc/api/cli.md#L2252-L2264

However, mocha another test runner that does not isolate tests, does accept a concurrency flag: https://mochajs.org/#parallel-tests

What is the feature you are proposing to solve the problem?

We're looking to move off of jest because its test module isolation is extremely slow. We love the idea of using the node-native test runner with isolation disabled, instead of adopting another third-party framework like mocha.

However, we'd need to write some custom code (e.g., using parallel) to spin up n concurrent, isolation-disabled tests to effectively utilize all the cores available on our CI machine.

The docs and other recent comments all indicate that when --experimental-test-isolation is set to 'none', concurrency must be 1. However, I couldn't find the reasoning in the original PR or issue.

There's probably a good reason for this but, as someone not intimately familiar with the implementation, it's not obvious to me why we wouldn't be able to run non-isolated tests concurrently, like in mocha.

What alternatives have you considered?

I could probably use a tool like parallel to spin up multiple calls to node --test. However, this would require me to also write code to split up all the test files between the parallel runs, etc.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la documentazione di --experimental-test-isolation in doc/api/cli.md, quindi leggi la PR originale #53927 e l’issue #51548 sui vincoli di concorrenza esistenti. Segui il punto di ingresso di node --test e determina come dovrebbero comportarsi i worker concorrenti non isolati; il lavoro è completo quando è supportata la combinazione di flag richiesta e viene documentata la relativa semantica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, nodejs
Ambito
cli, testing-qa
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.