Skip to content

test: enable 54 already-passing Node compat tests#33658

Open
nathanwhitbot wants to merge 6 commits intodenoland:mainfrom
nathanwhitbot:fix/node-compat-iter63
Open

test: enable 54 already-passing Node compat tests#33658
nathanwhitbot wants to merge 6 commits intodenoland:mainfrom
nathanwhitbot:fix/node-compat-iter63

Conversation

@nathanwhitbot
Copy link
Copy Markdown
Contributor

Summary

Enables 54 Node.js compat tests that already pass on main without any code changes. No production code touched — just tests/node_compat/config.jsonc entries.

  • parallel/test-net-connect-nodelay.js
  • parallel/test-net-connect-options-path.js
  • parallel/test-net-listen-exclusive-random-ports.js
  • parallel/test-net-listen-handle-in-cluster-2.js
  • parallel/test-net-pingpong.js
  • parallel/test-net-server-close-before-ipc-response.js
  • parallel/test-net-write-fully-async-hex-string.js
  • parallel/test-child-process-send-utf8.js
  • parallel/test-child-process-server-close.js
  • parallel/test-module-builtin.js
  • parallel/test-worker-http2-stream-terminate.js
  • parallel/test-dgram-cluster-bind-error.js
  • parallel/test-dgram-cluster-close-during-bind.js
  • parallel/test-dgram-cluster-close-in-listening.js
  • parallel/test-dgram-unref-in-cluster.js
  • parallel/test-fs-append-file.js
  • parallel/test-fs-watch-recursive-sync-write.js
  • parallel/test-fs-watch-recursive-update-file.js
  • parallel/test-fs-write-file-sync.js
  • parallel/test-https-agent-session-injection.js
  • parallel/test-https-client-reject.js
  • parallel/test-https-drain.js
  • parallel/test-https-localaddress.js
  • parallel/test-https-server-close-destroy-timeout.js
  • parallel/test-http2-exceeds-server-trailer-size.js
  • parallel/test-http2-generic-streams.js
  • parallel/test-http2-options-max-reserved-streams.js
  • parallel/test-http2-reset-flood.js
  • parallel/test-http2-server-push-stream-errors-args.js
  • parallel/test-http2-server-socket-destroy.js
  • parallel/test-http2-util-nghttp2error.js
  • parallel/test-diagnostics-channel-http2-client-stream-close.js
  • parallel/test-diagnostics-channel-http2-client-stream-finish.js
  • parallel/test-diagnostics-channel-http2-server-stream-close.js
  • parallel/test-diagnostics-channel-http2-server-stream-created-start-timing.js
  • parallel/test-diagnostics-channel-http2-server-stream-created.js
  • parallel/test-diagnostics-channel-http2-server-stream-finish.js
  • parallel/test-diagnostics-channel-http2-server-stream-start.js
  • parallel/test-fastutf8stream-end.js
  • parallel/test-fastutf8stream-flush-sync.js
  • parallel/test-fastutf8stream-flush.js
  • parallel/test-fastutf8stream-mode.js
  • parallel/test-fastutf8stream-partial-write-utf8.js
  • parallel/test-fastutf8stream-periodicflush.js
  • parallel/test-fastutf8stream-reopen.js
  • parallel/test-file-write-stream.js
  • parallel/test-file-write-stream4.js
  • parallel/test-perf-hooks-timerify-error.js
  • parallel/test-perf-hooks-timerify-invalid-args.js
  • parallel/test-perf-hooks-timerify-multiple-wrapping.js
  • parallel/test-perf-hooks-timerify-return-value.js
  • parallel/test-promise-unhandled-throw.js
  • parallel/test-source-map-invalid-url.js
  • parallel/test-v8-collect-gc-profile-in-worker.js

Test plan

  • Each test verified passing via the node_compat test runner
  • Full cargo test --test node_compat run on Linux confirms no regressions from the additions

Copy link
Copy Markdown
Contributor Author

@nathanwhitbot nathanwhitbot left a comment

Choose a reason for hiding this comment

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

Scope: first commit c001540 (fix(ext/node): support signal option in fs.watch/fs.promises.watch) is the open #33650 work, not part of this PR's intent. Same pattern @nathanwhit flagged on #33653 — please drop or rebase past it so the PR is purely the 54 config.jsonc enables.

Copy link
Copy Markdown
Contributor Author

@nathanwhitbot nathanwhitbot left a comment

Choose a reason for hiding this comment

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

Update: scope got worse, not better. New commit fd173ad4 (test: catch AbortError from fs.promises.watch async iterator) is also from #33650. PR now has 3 unrelated commits: c001540, fd173ad, plus the upstream merge. Files touched include ext/node/polyfills/fs.ts (+36/-4) and tests/unit_node/_fs/_fs_watch_test.ts — both should be 0 if the PR were purely test-enables.

@nathanwhit pinging since the bot isn't dropping the unrelated commits despite the prior scope note.

@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

Windows fails: 3 tests in this PR don't pass on windows-x86_64:

  • test-child-process-send-utf8.js — Mismatched function call count
  • test-child-process-server-close.js — timeout 10s
  • test-net-connect-options-path.js — failed (shard 3/3)

Per @bartlomieju's note on #33593: drop them from the PR rather than gate with windows: false. (Independent of the scope-creep ping above — these still need to come out before merge.)

nathanwhitbot pushed a commit to nathanwhitbot/deno that referenced this pull request Apr 28, 2026
@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

2 more Windows fails on debug windows-x86_64 (3/3): test-net-pingpong.js (timeout 10s) and test-worker-http2-stream-terminate.js. Drop both.

nathanwhitbot pushed a commit to nathanwhitbot/deno that referenced this pull request Apr 28, 2026
@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

Linux fails are infra: test integration (1/2) and test specs (2/2) debug linux-x86_64 both died at "Decompressing sysroot..." with exit code 8 (pre-test step). Sysroot decompress flake — @nathanwhit re-run when convenient.

@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

Third failure on run 25081051632 is wpt release linux-x86_64/workers/Worker-timeout-decreasing-order.html (5871 passed; 1 failed; expectation says true). Same wpt job has been green on the last two main pushes (run 25066750581, run 25053398914), and this PR only touches ext/node/polyfills/fs.ts, tests/node_compat/config.jsonc, and tests/unit_node/_fs/_fs_watch_test.ts — nothing that could affect worker timer ordering. Flake. cc @nathanwhit when you're rerunning the linux infra fails.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

Two concerns before this lands.

Title doesn't match the diff

The PR is titled test: enable 54 already-passing Node compat tests but the diff also includes production code changes in ext/node/polyfills/fs.ts:

  • New signal?: AbortSignal member on the watchOptions type
  • AbortSignal handling in fs.watch (close-on-abort, listener registration, deferred close on pre-aborted)
  • AbortSignal-aware next() in fs.promises.watch that throws AbortError with cause: signal?.reason

If those are needed to make some of the enrolled tests pass, the PR title should be fix(ext/node): support signal option in fs.watch / fs.promises.watch and enable 54 compat tests (or split into two PRs). Pure test-enrollment PRs that touch production code under that title are easy to miss in review later.

Duplicates #33650

This is the same substance as #33650 (also fix(ext/node): support signal option in fs.watch/fs.promises.watch). That PR has had two review iterations and is the more complete version — it includes things this one doesn't:

  • validateAbortSignal(options?.signal, "options.signal") — defensive validation throwing ERR_INVALID_ARG_TYPE for non-AbortSignal values
  • fsWatcher.once("close", () => signal.removeEventListener("abort", onAbort)) cleanup so the abort listener doesn't leak when the watcher closes naturally first
  • A cleanupAbort() helper called from three places in next() (top, after iterResult.done, and from a new return() method) so for await loops that break early also clean up the listener

The version here would land an earlier, less-careful copy of that code. Either rebase on top of #33650 once it lands, or pick up the cleanup helpers here. Whichever one merges second will need to remove the duplicate fs.ts changes.

CI

129 success, 4 failure, 2 skipped:

  • test integration (1/2) debug linux-x86_64 and test specs (2/2) debug linux-x86_64 — both exit code 8 at sysroot decompression (Decompressing sysroot...), pure infrastructure flake unrelated to this PR.
  • wpt release linux-x86_64 — single failed test /workers/Worker-timeout-decreasing-order.html ("Unhandled error in child worker"). Unrelated to fs.watch.
  • ci status — aggregate of the above.

So the substance of the test enrollment looks fine; the actual relevant test node_compat and test unit_node shards are all green. The blockers are the title mismatch and the #33650 overlap, not the CI failures.

@nathanwhitbot nathanwhitbot force-pushed the fix/node-compat-iter63 branch from c160283 to 34a8ddc Compare April 29, 2026 01:43
@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

Force-pushed 34a8ddc34 addressing fibibot's #33658 / #33650 overlap concern.

Reset the branch to upstream/main and re-applied only the test-enrollment commits:

3100ae9d4  test: enable 54 already-passing Node compat tests
b3ad5557a  test: drop 3 Windows-failing tests from #33658
85953c3a0  test: drop test-fs-write-file-sync (Windows failure)
34a8ddc34  test: drop 2 more Windows-failing tests from #33658

The ext/node/polyfills/fs.ts signal-option work and the matching tests/unit_node/_fs/_fs_watch_test.ts update are gone from this PR — they continue to live in #33650 (which has the more complete version with validateAbortSignal, the close-event listener cleanup, and the cleanupAbort helper that fibibot referenced). Diff is now config.jsonc-only and the title test: enable 54 already-passing Node compat tests matches.

@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

After scope-down, test-fs-watch-recursive-promise.js still fails on linux-aarch64 and macos-aarch64 — that test exercises fs.promises.watch({ signal }) which depends on #33650 (still open). Drop it from this PR (and test-fs-watch-recursive-sync-write.js, test-fs-watch-recursive-update-file.js if those also depend on it) — they can be re-added in a follow-up after #33650 lands.

Test exercises fs.promises.watch({ signal }) which depends on the signal
option support in denoland#33650 (still open). Re-add in a follow-up after denoland#33650
lands.
@nathanwhitbot
Copy link
Copy Markdown
Contributor Author

Single-shard fail on test node_compat (3/3) debug windows-x86_64 is the same test-dns-resolver-max-timeout.js timing flake hitting #33636 right now. Unrelated to this PR's config-only test enrollment. All 28 other node_compat shards pass. @nathanwhit re-run when convenient.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

LGTM. Pure config-jsonc addition (48 lines added, no production code touched). The 54 newly-enabled tests all passed in CI; the single test node_compat (3/3) debug windows-x86_64 failure is on parallel/test-dns-resolver-max-timeout.js (timeout1: 507, timeout2: 516 — millisecond-granular > assertion that the Windows OS scheduler doesn't always satisfy) which is already enabled in main and not in this PR's diff. Same recurring flake that's hit ~6 PRs today.

The macOS / Linux / Windows-aarch64 shards all green confirm the new tests work. Worth a separate cleanup later to either mark test-dns-resolver-max-timeout.js as flaky: true in config or bump its timing tolerance, since it's been blocking ~half the daily PRs on a single millisecond-comparison assertion.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants