Skip to content

test: fix watch cwd argv test flake#64084

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:test-run-watch-cwd-isolation-none-argv
Open

test: fix watch cwd argv test flake#64084
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:test-run-watch-cwd-isolation-none-argv

Conversation

@trivikr

@trivikr trivikr commented Jun 23, 2026

Copy link
Copy Markdown
Member

This fixes a flaky watch mode test by keeping the marker file outside the
watched cwd.

The test runs run({ watch: true, cwd, isolation: 'none' }) without explicit
files, so the runner watches the whole cwd. On Linux, writing the marker file
inside that cwd can trigger a watch restart before the test aborts the stream,
causing a second test:pass event.

The marker is now written in the parent tmpdir while the test file lives in a
dedicated watched subdirectory.

Refs: https://github.com/nodejs/reliability/issues?q=%22test-run-watch-cwd-isolation-none-argv%22

Example
not ok 5145 test-runner/test-run-watch-cwd-isolation-none-argv
  ---
  duration_ms: 866.79500
  severity: fail
  exitcode: 1
  stack: |-
    Mismatched noop function calls. Expected exactly 1, actual 2.
        at Module.mustCall (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/index.js:468:10)
        at file:///home/iojs/build/workspace/node-test-commit-linuxone/test/test-runner/test-run-watch-cwd-isolation-none-argv.mjs:39:31
        at ModuleJob.run (node:internal/modules/esm/module_job:447:25)
        at async node:internal/modules/esm/loader:646:26
        at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Assisted-by: openai:gpt-5.5

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 23, 2026
@trivikr trivikr added test_runner Issues and PRs related to the test runner subsystem. flaky-test Issues and PRs related to the tests with unstable failures on the CI. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 23, 2026
@trivikr trivikr force-pushed the test-run-watch-cwd-isolation-none-argv branch from ce91536 to cbf6881 Compare June 27, 2026 17:28
@trivikr trivikr added the review wanted PRs that need reviews. label Jun 28, 2026
@trivikr trivikr force-pushed the test-run-watch-cwd-isolation-none-argv branch from cbf6881 to dfa6989 Compare June 29, 2026 23:52
@trivikr

This comment was marked as outdated.

@trivikr

trivikr commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Keep the marker file outside the watched cwd so writing it does not
trigger an extra watch mode rerun on Linux.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
@trivikr trivikr force-pushed the test-run-watch-cwd-isolation-none-argv branch from dfa6989 to 6447fb1 Compare June 30, 2026 22:21
@trivikr trivikr removed the review wanted PRs that need reviews. label Jul 1, 2026
@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 1, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 1, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. flaky-test Issues and PRs related to the tests with unstable failures on the CI. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants