File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1158,15 +1158,20 @@ mod tests {
11581158 let packet_socket0 =
11591159 s2n_quic_core:: crypto:: initial:: EXAMPLE_CLIENT_INITIAL_PROTECTED_PACKET ;
11601160 while !cancel. load ( Ordering :: Relaxed ) {
1161- let _ = sender. send_to ( & packet_socket1, server_addr) ;
1161+ // Send 10 packets to socket 1 for every 1 to socket 0.
1162+ // This creates a natural backlog on socket 1,
1163+ // ensuring the priority scheduling has a clear effect.
1164+ for _ in 0 ..10 {
1165+ let _ = sender. send_to ( & packet_socket1, server_addr) ;
1166+ }
11621167 let _ = sender. send_to ( & packet_socket0, server_addr) ;
1163- count. fetch_add ( 2 , Ordering :: Relaxed ) ;
1168+ count. fetch_add ( 11 , Ordering :: Relaxed ) ;
11641169 }
11651170 } )
11661171 } ;
11671172
1168- // Let the flood run for 1 second
1169- tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
1173+ // Let the flood run for 2 second
1174+ tokio:: time:: sleep ( Duration :: from_secs ( 2 ) ) . await ;
11701175
11711176 // Stop the flood
11721177 cancel. store ( true , Ordering :: Relaxed ) ;
You can’t perform that action at this time.
0 commit comments