forked from quic-go/quic-go
continue hybrid slow start implementation
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package congestion_test
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/congestion"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
@@ -44,4 +46,30 @@ var _ = Describe("Hybrid slow start", func() {
|
||||
packet_number++
|
||||
Expect(slowStart.IsEndOfRound(packet_number)).To(BeTrue())
|
||||
})
|
||||
|
||||
It("works with delay", func() {
|
||||
rtt := 60 * time.Millisecond
|
||||
// We expect to detect the increase at +1/8 of the RTT; hence at a typical
|
||||
// RTT of 60ms the detection will happen at 67.5 ms.
|
||||
const kHybridStartMinSamples = 8 // Number of acks required to trigger.
|
||||
|
||||
end_packet_number := uint64(1)
|
||||
end_packet_number++
|
||||
slowStart.StartReceiveRound(end_packet_number)
|
||||
|
||||
// Will not trigger since our lowest RTT in our burst is the same as the long
|
||||
// term RTT provided.
|
||||
for n := 0; n < kHybridStartMinSamples; n++ {
|
||||
Expect(slowStart.ShouldExitSlowStart(rtt+time.Duration(n)*time.Millisecond, rtt, 100)).To(BeFalse())
|
||||
}
|
||||
end_packet_number++
|
||||
slowStart.StartReceiveRound(end_packet_number)
|
||||
for n := 1; n < kHybridStartMinSamples; n++ {
|
||||
Expect(slowStart.ShouldExitSlowStart(rtt+(time.Duration(n)+10)*time.Millisecond, rtt, 100)).To(BeFalse())
|
||||
}
|
||||
// Expect to trigger since all packets in this burst was above the long term
|
||||
// RTT provided.
|
||||
Expect(slowStart.ShouldExitSlowStart(rtt+10*time.Millisecond, rtt, 100)).To(BeTrue())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user