Skip to content

test: fix watch cwd argv test flake - #64084

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

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

@trivikrtrivikr 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-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 23, 2026
@trivikrtrivikr 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
trivikrforce-pushed the test-run-watch-cwd-isolation-none-argv branch from ce91536 to cbf6881CompareJune 27, 2026 17:28
@trivikrtrivikr added the review wanted PRs that need reviews. label Jun 28, 2026
@trivikr
trivikrforce-pushed the test-run-watch-cwd-isolation-none-argv branch from cbf6881 to dfa6989CompareJune 29, 2026 23:52
@trivikr

This comment was marked as outdated.

@trivikr

trivikr commented Jun 30, 2026

Copy link
Copy Markdown
MemberAuthor

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
trivikrforce-pushed the test-run-watch-cwd-isolation-none-argv branch from dfa6989 to 6447fb1CompareJune 30, 2026 22:21
@trivikrtrivikr removed the review wanted PRs that need reviews. label Jul 1, 2026
@aduh95aduh95 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-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 1, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr

Copy link
Copy Markdown
MemberAuthor

Closing as stress test is not failing in main https://ci.nodejs.org/job/node-stress-single-test/780/, so it's possible that the flakiness is not in code.

The stress test needs to fail in main for a successful code fix for flaky test as per #64223 (comment)

@trivikrtrivikr closed this Jul 1, 2026
@trivikr
trivikr deleted the test-run-watch-cwd-isolation-none-argv branch July 1, 2026 21:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@trivikr@nodejs-github-bot@panva@aduh95