Skip to content

test: relax chunk count expectations

In parallel/test-fs-read-stream-concurrent-reads.js the number of data chunks used is being tested when few concurrent reads are performed. The number of chunks can fluctuate based on the number of concurrent reads as well as the data that was read in one shot. Accommodate these variations in the test.

Rational for M * 2 in the assertion statement: Number of chunks are clearly a function of the (for) loop iteration, and hence M Number of chunks are rarely increase based on the number of iterations it took complete one read. Mostly one, rarely 2. Accommodate this fluctuation by taking the worst case situation: all the reads take 2 iterations. And hence M * 2.

Fixes: https://github.com/nodejs/node/issues/22339

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

ping @nodejs/testing @addaleax @trott

Merge request reports

Loading