forked from quic-go/quic-go
use synctest to make the connection tests fully deterministic (#5317)
This commit is contained in:
@@ -670,7 +670,7 @@ runLoop:
|
||||
} else {
|
||||
idleTimeoutStartTime := c.idleTimeoutStartTime()
|
||||
if (!c.handshakeComplete && now.Sub(idleTimeoutStartTime) >= c.config.HandshakeIdleTimeout) ||
|
||||
(c.handshakeComplete && now.After(c.nextIdleTimeoutTime())) {
|
||||
(c.handshakeComplete && !now.Before(c.nextIdleTimeoutTime())) {
|
||||
c.destroyImpl(qerr.ErrIdleTimeout)
|
||||
break runLoop
|
||||
}
|
||||
@@ -878,7 +878,7 @@ func (c *Conn) maybeResetTimer() {
|
||||
|
||||
func (c *Conn) idleTimeoutStartTime() monotime.Time {
|
||||
startTime := c.lastPacketReceivedTime
|
||||
if t := c.firstAckElicitingPacketAfterIdleSentTime; t.After(startTime) {
|
||||
if t := c.firstAckElicitingPacketAfterIdleSentTime; !t.IsZero() && t.After(startTime) {
|
||||
startTime = t
|
||||
}
|
||||
return startTime
|
||||
|
||||
2354
connection_test.go
2354
connection_test.go
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user