Skip to content

test: fix flaky test

Rodrigo Muino Tomonari requested to merge github/fork/cjihrig/test-fix into master

This commit fixes test-tls-set-secure-context.js. The test was making one long lasting HTTP connection, followed by a number of shorter lived connections. However, it was possible that the connections were not received in the desired order. This commit ensures that the long lasting connection is established before making any other connections.

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

Before this change, the command tools/test.py -j 8 --repeat 1000 test/parallel/test-tls-set-secure-context.js failed approximately 1% of the time for me locally. With this change, I haven't seen a failure after two such runs.

cc: @targos

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading