Skip to content

test: fix flaky test-trace-sigint-on-idle

Previously, the test could fail on slow machines because the child process was still in the process of starting up after one second, and not yet idle.

To resolve this:

  • Wait for a message from the child process indicating that it had started.
  • Wait some time after that, but make it platform-dependent to account for timing differences.
  • Remove the timer in the child process.

Example failure: https://ci.nodejs.org/job/node-test-binary-arm-12+/4163/RUN_SUBSET=0,label=pi2-docker/testReport/junit/(root)/test/pseudo_tty_test_trace_sigint_on_idle/

KEYBOARD_INTERRUPT: Script execution was interrupted by `SIGINT`
    at URL (internal/url.js:333:63)
    at pathToFileURL (internal/url.js:1383:18)
    at Module.load (internal/modules/cjs/loader.js:1061:18)
    at Module._load (internal/modules/cjs/loader.js:952:14)
    at executeUserEntryPoint (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
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