Skip to content

fix: harden selective retransmit test with multi-attempt strategy#76

Merged
algesten merged 1 commit intoalgesten:mainfrom
HMBSbige:fix/harden-selective-retransmit-test
Mar 5, 2026
Merged

fix: harden selective retransmit test with multi-attempt strategy#76
algesten merged 1 commit intoalgesten:mainfrom
HMBSbige:fix/harden-selective-retransmit-test

Conversation

@HMBSbige
Copy link
Contributor

@HMBSbige HMBSbige commented Mar 5, 2026

The dtls13_selective_retransmit_only_missing_records test was flaky because it assumed the first retransmission after a dropped packet would always be selective. In practice, a duplicate-triggered (dupe triggers resend) full-flight resend can occur before the peer's ACK narrows the retransmission scope.

This PR rewrites the test to be robust against that timing:

  • Run up to 12 attempts with varying deterministic RNG seeds and drop positions, so different fragmentation layouts are exercised without relying on runtime RNG.
  • Deliver all client packets normally (no epoch-0 filtering), keeping the handshake state machine realistic.
  • Tolerate full-flight resends, and keep waiting until a selective resend (fewer packets than original flight) is observed.
  • Require both selective retransmit and successful handshake completion before declaring success.
  • Report detailed diagnostics on failure (attempts with drop / retransmit / client epoch-2 delivery / connection counts).

Use deterministic RNG seeds and varying drop positions across multiple
attempts to reliably observe selective retransmission, tolerating
dupe-triggered full-flight resends and verifying handshake completion.
@HMBSbige HMBSbige force-pushed the fix/harden-selective-retransmit-test branch from 63f1f45 to 40ec91c Compare March 5, 2026 12:40
@algesten algesten merged commit 57218a5 into algesten:main Mar 5, 2026
45 checks passed
@algesten
Copy link
Owner

algesten commented Mar 5, 2026

Thanks!

@HMBSbige HMBSbige deleted the fix/harden-selective-retransmit-test branch March 6, 2026 01:47
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.

2 participants