Skip to content

Commit 490094b

Browse files
committed
Ignore key discard timer when detecting activity in unit tests
This caused rare flakes in at least single_ack_eliciting_packet_triggers_ack_after_delay by classifying a the connection as active for longer than expected.
1 parent 8b464de commit 490094b

File tree

1 file changed

+2
-2
lines changed
  • quinn-proto/src/connection

1 file changed

+2
-2
lines changed

quinn-proto/src/connection/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,12 +3534,12 @@ impl Connection {
35343534
.saturating_sub(self.path.in_flight.bytes)
35353535
}
35363536

3537-
/// Whether no timers but keepalive, idle, rtt and pushnewcid are running
3537+
/// Whether no timers but keepalive, idle, rtt, pushnewcid, and key discard are running
35383538
#[cfg(test)]
35393539
pub(crate) fn is_idle(&self) -> bool {
35403540
Timer::VALUES
35413541
.iter()
3542-
.filter(|&&t| t != Timer::KeepAlive && t != Timer::PushNewCid)
3542+
.filter(|&&t| !matches!(t, Timer::KeepAlive | Timer::PushNewCid | Timer::KeyDiscard))
35433543
.filter_map(|&t| Some((t, self.timers.get(t)?)))
35443544
.min_by_key(|&(_, time)| time)
35453545
.map_or(true, |(timer, _)| timer == Timer::Idle)

0 commit comments

Comments
 (0)