-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Description
Not much to go off in the test result so here is the console output:
03:35:30 not ok 3270 parallel/test-runner-watch-mode 03:35:30 --- 03:35:30 duration_ms: 300610.62600 03:35:30 severity: fail 03:35:30 exitcode: -15 03:35:30 stack: |- 03:35:30 timeout 03:35:30 TAP version 13 03:35:30 ... So the failure is caused due to a timeout.
I ran the test manually adding a some console logs for debug purposes
-
Log child process stdout
-
Add Log to print the args the child process was spawned with
-
Add logs at the beginning of each test case to know which one we are in.
| const file1 = fixtures.path('test-runner/index.test.js'); |
| const file1 = fixtures.path('test-runner/index.test.js'); |
| const file1 = fixtures.path('test-runner/index.test.js'); |
./out/Release/node --expose-internals test/parallel/test-runner-watch-mode-fix.mjs In test 1 Spawned child process: [ '~/workspaces/ibmi73-ppc64/out/Release/node', '--watch', '--test', '--no-warnings', '~/workspaces/ibmi73-ppc64/test/fixtures/test-runner/index.test.js', '~/workspaces/ibmi73-ppc64/test/fixtures/test-runner/dependent.js' ] .... TAP version 13 # Subtest: test has ran ok 1 - test has ran --- duration_ms: 6.544531 ... # Subtest: this should pass ok 2 - this should pass --- duration_ms: 7.425007 ... 1..2 # tests 2 # suites 0 # pass 2 # fail 0 # cancelled 0 # skipped 0 # todo 0 # duration_ms 3050.210909The test case hangs here.
Looks like we are in the first test case.
The child was spawned was spawned with:
~/workspaces/ibmi73-ppc64/out/Release/node --watch --test --no-warnings ~/workspaces/ibmi73-ppc64/test/fixtures/test-runner/index.test.js ~/workspaces/ibmi73-ppc64fixtures/test-runner/dependent.jsTo isolate the outputs from each I ran them seperately:
- /fixtures/test-runner/index.test.js
__ this should pass (6.81041ms) _ tests 1 _ suites 0 _ pass 1 _ fail 0 _ cancelled 0 _ skipped 0 _ todo 0 _ duration_ms 2604.756049 | test('this should pass'); |
- fixtures/test-runner/dependent.js
__ ~/workspaces/ibmi73-ppc64/test/fixtures/test-runner/dependent.js (2312.521473ms) _ tests 1 _ suites 0 _ pass 1 _ fail 0 _ cancelled 0 _ skipped 0 _ todo 0 _ duration_ms 2382.128154 | test('test has ran'); |
The code in the test case has a regex to match - test has ran to determine when to resolve each promise.
node/test/parallel/test-runner-watch-mode.mjs
Lines 17 to 19 in 10b21e5
| const testRuns = stdout.match(/ - test has ran/g); | |
| if (testRuns?.length >= 1) ran1.resolve(); | |
| if (testRuns?.length >= 2) ran2.resolve(); |
We get one match from fixtures/test-runner/dependent.js but fixtures/test-runner/index.test.js logs this should pass.
Therefore the second promise never gets resolved causing the timeout.
Is there something wrong with the regex check? Should it be looking for this should pass as well?
Or is there some other issue?
CC @richardlau
CC @nodejs/platform-ibmi