cultnet-rs: test that a send queued behind a full window gets a pending receipt

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 10:38:57 +01:00
commit 8e6c7d177e

View file

@ -1021,3 +1021,20 @@ fn the_hub_admits_a_pinned_client_that_restarts_on_the_same_address() -> Result<
assert!(restarted.connected(), "the restarted pinned client was never admitted");
Ok(())
}
/// A send that lands behind a full flow window is queued, not refused: it gets
/// a receipt for the sequence it was assigned, and the receipt reads Pending
/// while the packet is still queued. (Slow acknowledgements fill the window on
/// a loaded host; a silent peer fills it here without a clock.)
#[test]
fn a_send_queued_behind_a_full_window_returns_a_pending_receipt() -> Result<()> {
let server = socket()?;
let server_addr = server.local_addr()?;
let mut client = connected_client(&server, server_addr)?;
for _ in 0..CULTNET_RUDP_RELIABLE_SEND_WINDOW_PACKETS {
client.send_reliable("schema", b"fill".to_vec())?;
}
let receipt = client.send_reliable("schema", b"queued".to_vec())?;
assert_eq!(client.reliable_send_status(&receipt), CultNetRudpReliableSendStatus::Pending);
Ok(())
}