Skip to content

test(dgram): expand granular Node parity coverage#6442

Open
TheHypnoo wants to merge 5 commits into
mainfrom
test/expand-node-dgram-parity
Open

test(dgram): expand granular Node parity coverage#6442
TheHypnoo wants to merge 5 commits into
mainfrom
test/expand-node-dgram-parity

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Expand the granular node:dgram parity suite from 4 broad fixtures to 38 focused fixtures, using current Node, Deno, and Bun compatibility corpora as primary evidence. The suite now preserves 18 passing behaviors and 20 stable Perry differences as diagnostic regression cases.

Changes

  • add 34 granular fixtures across validation, lifecycle, connection state, send behavior, socket controls, callback timing, buffer/queue metrics, and ref/unref behavior
  • cover advanced socket/address validation, legacy sendto(), DataView and scatter-gather sends, connected range guards, custom lookup, close/dispose and connect ordering, bind conflicts/retries, block lists, DNS error routing, constructor buffer options, send bounds, empty arrays, implicit binding, TTL boundaries, constructor listeners, and callback byte counts
  • document current upstream commits and representative Node/Deno/Bun case mappings in test-parity/node-suite/dgram/STATUS.md
  • retain 20 deterministic Perry differences, including missing validation, synchronous send callbacks, unsupported scatter-gather/block lists/custom lookup/async disposal, ignored buffer ranges, and return/normalization differences
  • ratchet the measured dgram floor to 18/38 while leaving aggregate metadata at its last clean full-suite snapshot
  • keep all bound ports ephemeral and loopback-only; exclude reusePort, shared ports, cluster/fd transfer, unguarded IPv6, interface multicast, kernel error paths, and scheduler-sensitive stress/races

Related issue

n/a — standalone parity-suite expansion.

Test plan

NODE_BIN=/tmp/node-v26.5.0/bin/node \
python3 scripts/node_suite_run.py "$PWD/target/release/perry" "$PWD" dgram

module                 pass  total      %
dgram                    18     38   47.4  diff=20
OVERALL node-suite: 18/38 (47.4%)
cargo fmt --all -- --check
./scripts/check_file_size.sh
python3 -m json.tool test-parity/node_suite_baseline.json
git diff --check
  • cargo build --release clean (performed by the focused parity wrapper before the fixture-only follow-up)
  • cargo test --workspace --exclude perry-ui-ios --exclude perry-ui-tvos --exclude perry-ui-watchos --exclude perry-ui-gtk4 --exclude perry-ui-android --exclude perry-ui-windows passes — not run; no Rust source changed
  • Added focused tests under test-parity/node-suite/dgram/
  • Documentation updated in the suite-local STATUS.md
  • Platform UI build not applicable

Screenshots / output

The focused baseline runner completed with 18 passes, 20 stable output diffs, and no compile_fail, perry_err, or node_err buckets.

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md
  • My commits follow the repository commit-prefix convention
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

Summary by CodeRabbit

  • Tests
    • Expanded dgram parity with new UDP socket scripts covering connection state transitions, connect/disconnect ordering, bind/close behavior, abort-signal handling, TTL/setMulticastTTL validation, and buffer/queue metrics.
    • Added send/receive coverage for callback ordering, connected/implicit default host, empty payloads/empty arrays, buffer slices/ranges, message views, sendto/argument validation, error routing, blocklists, and bind conflicts.
  • Documentation
    • Expanded the dgram parity status report with fixture counts, deterministic comparison rules, and enumerated behavioral differences.
  • Maintenance
    • Updated the dgram baseline thresholds to 18/38.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 14af7b66-5d48-4180-aa92-4d8108a286a4

📥 Commits

Reviewing files that changed from the base of the PR and between 42cf2b3 and d26023d.

📒 Files selected for processing (1)
  • test-parity/node-suite/dgram/lifecycle/bind-error-retry.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test-parity/node-suite/dgram/lifecycle/bind-error-retry.ts

📝 Walkthrough

Walkthrough

Changes

dgram parity coverage

Layer / File(s) Summary
Fixture scope and baseline
test-parity/node-suite/dgram/STATUS.md, test-parity/node_suite_baseline.json
Documents upstream evidence, 38 fixtures, stable differences, exclusions, and verification commands, then raises the dgram baseline from 4/4 to 18/38.
Socket lifecycle and state transitions
test-parity/node-suite/dgram/connection/*, test-parity/node-suite/dgram/lifecycle/*, test-parity/node-suite/dgram/metrics/queue-and-ref.ts
Adds coverage for connection ordering and transitions, bind overloads, conflicts and retries, abort signals, disposal and close behavior, custom lookup, queue metrics, and ref state.
Datagram sending behavior
test-parity/node-suite/dgram/send/*
Adds send/receive coverage for overloads, connected and default-host sends, empty and multiple datagrams, implicit binding, callback ordering, ranges, listeners, error routing, blocklists, and address defaults.
Socket and send validation
test-parity/node-suite/dgram/validation/*
Adds diagnostics for socket options, send and address arguments, connected-send restrictions, message views, scatter payloads, buffer bounds, empty arrays, and sendto() arguments.
Socket metrics and control validation
test-parity/node-suite/dgram/control/*, test-parity/node-suite/dgram/metrics/*
Adds validation coverage for TTL, queue metrics, buffer-size operations, and configured socket buffer options.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • PerryTS/perry#5166: Updates parity baseline metadata and module pass-floor thresholds in the same baseline configuration.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: expanded granular Node parity coverage for dgram.
Description check ✅ Passed The description follows the template and includes summary, changes, issue, test plan, screenshots, and checklist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/expand-node-dgram-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@TheHypnoo

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test-parity/node-suite/dgram/lifecycle/bind-error-retry.ts`:
- Around line 11-13: Annotate the error callback parameter in the candidate.once
error handler as NodeJS.ErrnoException (or an equivalent type containing code
and syscall) so those properties compile under strict TypeScript settings.
Preserve the existing resolve format and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83c2e1fa-7aa9-456f-b791-cf4269cf9143

📥 Commits

Reviewing files that changed from the base of the PR and between c39a79d and 42cf2b3.

📒 Files selected for processing (10)
  • test-parity/node-suite/dgram/STATUS.md
  • test-parity/node-suite/dgram/connection/connect-ordering.ts
  • test-parity/node-suite/dgram/lifecycle/bind-error-retry.ts
  • test-parity/node-suite/dgram/lifecycle/close-ordering.ts
  • test-parity/node-suite/dgram/metrics/create-socket-buffer-options.ts
  • test-parity/node-suite/dgram/send/empty-array.ts
  • test-parity/node-suite/dgram/send/implicit-bind-state.ts
  • test-parity/node-suite/dgram/validation/buffer-bounds.ts
  • test-parity/node-suite/dgram/validation/message-views.ts
  • test-parity/node_suite_baseline.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • test-parity/node-suite/dgram/validation/message-views.ts
  • test-parity/node_suite_baseline.json

Comment thread test-parity/node-suite/dgram/lifecycle/bind-error-retry.ts
TheHypnoo and others added 2 commits July 16, 2026 08:53
@proggeramlug proggeramlug added the ready PR triaged: CodeRabbit feedback + conflicts addressed label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PR triaged: CodeRabbit feedback + conflicts addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants