Skip to content

test: deflake async-hooks statwatcher test#63396

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:flaky-test-statwatcher
Open

test: deflake async-hooks statwatcher test#63396
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:flaky-test-statwatcher

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 18, 2026

This updates async-hooks/test-statwatcher to wait until fs.watchFile()
has observed the initial missing-file state before writing the watched files.

Without that ordering, uv_fs_poll can race with the test write and use the
newly created file as its initial baseline. In that case no later change is
emitted, so the test can hang until the harness timeout.

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


Assisted-by: openai:gpt-5.5

Wait for the initial missing-file poll before writing watched files.
Otherwise uv_fs_poll can observe the created file as its baseline and
never emit the expected change event.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooks Issues and PRs related to the async hooks subsystem. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants