node icon indicating copy to clipboard operation
node copied to clipboard

test_runner: introduce NODE_TEST_WORKER_ID for improved concurrent te…

Open cu8code opened this issue 2 months ago • 8 comments

ref: #55842

Added a new environment variable, NODE_TEST_WORKER_ID, which ranges from 1 to N when --experimental-test-isolation=process is enabled and defaults to 1 when --experimental-test-isolation=none is used.

Before merging, I want to add some tests but haven't come up with a good approach yet. Here's what I aim to test:

  • When --experimental-test-isolation=process is enabled, verify that NODE_TEST_WORKER_ID ranges from 1 to N.
  • When --experimental-test-isolation=none is used, ensure that NODE_TEST_WORKER_ID is set to 1.

Any suggestions on how to create such tests would be greatly appreciated!

cu8code avatar Nov 30 '24 19:11 cu8code