From 8aa2274fc9c9538f7e4b99010bae8c9372854632 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 17 Jul 2024 14:43:42 +0000 Subject: [PATCH] Fix optimistic ack test and note randomness dependency --- quic/s2n-quic/src/tests/skip_packets.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quic/s2n-quic/src/tests/skip_packets.rs b/quic/s2n-quic/src/tests/skip_packets.rs index b4b9952922..c528bc5c05 100644 --- a/quic/s2n-quic/src/tests/skip_packets.rs +++ b/quic/s2n-quic/src/tests/skip_packets.rs @@ -88,8 +88,11 @@ fn optimistic_ack_mitigation() { // Verify that both client and server are skipping packets for Optimistic // Ack attack mitigation. - assert_eq!(server_skip_count, 5); - assert_eq!(client_skip_count, 5); + // + // The exact number of skipped packets depends on randomness, so this test may be changed by + // unrelated changes. The important thing is that both numbers are non-zero. + assert_eq!(server_skip_count, 4); + assert_eq!(client_skip_count, 4); } // Mimic an Optimistic Ack attack and confirm the connection is closed with