Skip to content

Fix UDP test synchronization across ticks - #34

Merged
treeform merged 2 commits into
masterfrom
fix-udp-test-synchronization
Oct 2, 2026
Merged

treeform merged 2 commits into
masterfrom
fix-udp-test-synchronization

Conversation

@treeform

@treeform treeform commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

The macOS build fails at c2s.sendParts.len < 122 when the first ACK has not arrived by the next client tick. UDP sends and peer ticks do not guarantee that data or ACKs are immediately readable. The failure was reproduced locally from the original window test.

Wait for observable progress with a thirty-second monotonic deadline in the main suite's message, ACK, connection, and disconnect checks. The window test now explicitly checks that another sender tick cannot advance the queue before the server produces ACKs, then pumps both peers until both messages arrive and every part is acknowledged. It checks the byte limit on every sender tick and validates payloads and sequence numbers while accumulating messages across ticks.

The large-message checks now require delivery and acknowledgements within the deadline and report transfer duration, instead of accepting no messages or waiting for a connection timeout. The remote disconnect check freezes protocol time so a timeout cannot satisfy it.

Validation on macOS with Nim 2.2.12, matching CI:

  • nim check passed for the main and hardening suites; all three suites passed.
  • 10 complete main-suite runs passed with the existing timing sleeps, and 10 passed with nettyMagicSleep disabled.
  • A temporary harness ran the revised window test 1,000 times without the legacy sleeps.
  • 20 harness runs passed with only one datagram read per tick, forcing partial ACK delivery across ticks.
  • Suppressing all ACK packets correctly failed at the wait deadline.
  • Final CI passed on macOS, Linux, and Windows. The hosted macOS bulk transfer took 6,762 ms versus 2,001 ms locally, supporting a deadline that allows slower runners.

Fixes the failure in the macOS master build after #33. No runtime behavior changes.

@treeform
treeform merged commit c9a76ed into master Oct 2, 2026
3 checks passed
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.

1 participant