Skip to content

test: reduce watch mode restart flakiness - #63390

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:flaky-test-watch-mode-restart-esm-loading-error
May 24, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:flaky-test-watch-mode-restart-esm-loading-error

Conversation

@trivikr

@trivikr trivikr commented May 17, 2026

Copy link
Copy Markdown
Member

Fixes intermittent failures in
test-watch-mode-restart-esm-loading-error.mjs.

The test now starts waiting for the watch restart before writing the file and
waits for a platform-scaled settling period before the next mutation. This
reduces races with filesystem watch event delivery and dependency reporting
from the watched child process on slower CI machines.

Refs: https://github.com/nodejs/reliability/blob/main/reports/2026-05-16.md#jstest-failure


Assisted-by: openai:gpt-5.5

Start waiting for each watch restart before writing the file, then wait
for a platform-scaled settling period before mutating it again.

This gives watch mode time to process filesystem events and dependency
reporting from the child process on slower CI machines.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
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 Node.js core tests and test infrastructure. labels May 17, 2026
@codecov

codecov Bot commented May 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.04%. Comparing base (550f195) to head (1a627f9).
⚠️ Report is 98 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63390      +/-   ##
==========================================
- Coverage   90.06%   90.04%   -0.02%     
==========================================
  Files         714      714              
  Lines      225648   225648              
  Branches    42711    42698      -13     
==========================================
- Hits       203237   203192      -45     
- Misses      14200    14257      +57     
+ Partials     8211     8199      -12     

see 54 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label May 17, 2026

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label May 18, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label May 18, 2026
@aduh95 aduh95 added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label May 19, 2026
Comment on lines +116 to +118
const failedRestart = restart(common.platformTimeout(10_000));
writeFileSync(file, syntaxErrorContent);

await sleep(common.platformTimeout(1000));