@@ -1835,8 +1835,7 @@ func TestAssocCongestionControl(t *testing.T) { //nolint:cyclop,maintidx
18351835 assert .Equal (t , n , len (sbuf ), "unexpected length of received data" )
18361836 }
18371837
1838- // process packets for 500 msec, assuming that the fast retrans/recover
1839- // should complete within 500 msec.
1838+ // process packets for 500 msec; recovery should complete without RTO
18401839 for i := 0 ; i < 50 ; i ++ {
18411840 br .Tick ()
18421841 time .Sleep (10 * time .Millisecond )
@@ -1860,7 +1859,7 @@ func TestAssocCongestionControl(t *testing.T) { //nolint:cyclop,maintidx
18601859 return
18611860 }
18621861 assert .Equal (t , len (sbuf ), n , "unexpected length of received data" )
1863- assert .Equal (t , i , int (binary .BigEndian .Uint32 (rbuf )), "unexpected length of received data " )
1862+ assert .Equal (t , i , int (binary .BigEndian .Uint32 (rbuf )), "unexpected payload sequence " )
18641863 assert .Equal (t , ppi , PayloadTypeWebRTCBinary , "unexpected ppi" )
18651864 }
18661865
@@ -1873,8 +1872,13 @@ func TestAssocCongestionControl(t *testing.T) { //nolint:cyclop,maintidx
18731872 t .Logf ("nSACKs : %d\n " , a0 .stats .getNumSACKsReceived ())
18741873 t .Logf ("nAckTimeouts: %d\n " , a1 .stats .getNumAckTimeouts ())
18751874 t .Logf ("nFastRetrans: %d\n " , a0 .stats .getNumFastRetrans ())
1875+ t .Logf ("nT3Timeouts : %d\n " , a0 .stats .getNumT3Timeouts ())
18761876
1877- assert .Equal (t , uint64 (1 ), a0 .stats .getNumFastRetrans (), "should be 1" )
1877+ // With RACK enabled, recovery may happen without classic fast retransmit.
1878+ // Require recovery before RTO; allow FR count to be 0 or 1.
1879+ assert .Equal (t , uint64 (0 ), a0 .stats .getNumT3Timeouts (), "recovery should complete before any RTO" )
1880+ fr := a0 .stats .getNumFastRetrans ()
1881+ assert .Truef (t , fr == 0 || fr == 1 , "expected fast retrans 0 or 1 (RACK may bypass FR), got %d" , fr )
18781882
18791883 closeAssociationPair (br , a0 , a1 )
18801884 })
0 commit comments