mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
rttstats: don't set initial RTT after having obtained a measurement (#3852)
This commit is contained in:
parent
cb3453db25
commit
02013caaa4
2 changed files with 15 additions and 1 deletions
|
@ -154,4 +154,14 @@ var _ = Describe("RTT stats", func() {
|
|||
Expect(rttStats.SmoothedRTT()).To(Equal(200 * time.Millisecond))
|
||||
Expect(rttStats.MeanDeviation()).To(Equal(100 * time.Millisecond))
|
||||
})
|
||||
|
||||
It("doesn't restore the RTT if we already have a measurement", func() {
|
||||
const rtt = 10 * time.Millisecond
|
||||
rttStats.UpdateRTT(rtt, 0, time.Now())
|
||||
Expect(rttStats.LatestRTT()).To(Equal(rtt))
|
||||
Expect(rttStats.SmoothedRTT()).To(Equal(rtt))
|
||||
rttStats.SetInitialRTT(time.Minute)
|
||||
Expect(rttStats.LatestRTT()).To(Equal(rtt))
|
||||
Expect(rttStats.SmoothedRTT()).To(Equal(rtt))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue