test_runner: fix watch cwd with isolation none#63690
Conversation
|
Review requested:
|
7e54c89 to
423a1e2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63690 +/- ##
==========================================
- Coverage 90.35% 90.35% -0.01%
==========================================
Files 732 732
Lines 236527 236531 +4
Branches 44535 44536 +1
==========================================
- Hits 213717 213716 -1
+ Misses 14533 14531 -2
- Partials 8277 8284 +7
🚀 New features to boost your workflow:
|
| tmpdir.refresh(); | ||
|
|
||
| const marker = join(tmpdir.path, 'marker'); | ||
| writeFileSync(join(tmpdir.path, 'test.js'), ` |
There was a problem hiding this comment.
Could this test program live as a fixture under test/fixtures/test-runner-watch/ for consistency with the other watch/cwd tests, instead of the inline template string?
There was a problem hiding this comment.
The other files in the fixtures directory are pure JS files, which are read as-is.
The string in this template contains a variable which prints the marker string. So it can't have .js prefix.
I'll keep it as-is unless there's a strong recommendation to move it to fixtures folder.
When watch mode runs with isolation disabled, spawn the child test runner with the files or glob patterns from the current run instead of reusing the parent process argv. This keeps discovery scoped to the configured cwd and avoids rerunning the driver test when the parent argv points outside that cwd. Fixes: nodejs#63689 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
423a1e2 to
9832b66
Compare
When
run({ watch: true, cwd, isolation: 'none' })spawned the watch child,it reused the parent process argv while changing the child process cwd. That
could make the child run the outer test file, recurse, or miss the test file
that was discovered under the configured cwd.
This updates the isolation-none watch path to spawn the child test runner with
the current run's explicit files or glob patterns instead of
process.argv.A regression test verifies that the cwd-scoped test file actually runs.
Fixes: #63689
Fixes a flaky failure in
test-runner/test-run-watch-cwd-isolation-none.Refs: https://github.com/nodejs/reliability/blob/main/reports/2026-06-01.md#jstest-failure
Example error log
Assisted-by: openai:gpt-5.5