neqo/test-fixture
Max Inden a87b379941
fix(sim): correct `Waiting` state comparison in `NodeHolder::ready()` (#2263)
A `Node` (e.g. a `Client`, `Server` or `TailDrop` router) can be in 3 states:

``` rust
enum NodeState {
    /// The node just produced a datagram.  It should be activated again as soon as possible.
    Active,
    /// The node is waiting.
    Waiting(Instant),
    /// The node became idle.
    Idle,
}
```

`NodeHolder::ready()` determines whether a `Node` is ready to be processed
again. When `NodeState::Waiting`, it should only be ready when `t <= now`, i.e.
the waiting time has passed, not `t >= now`.

``` rust
impl NodeHolder {
    fn ready(&self, now: Instant) -> bool {
        match self.state {
            Active => true,
            Waiting(t) => t <= now, // not >=
            Idle => false,
        }
    }
}
```

The previous behavior lead to wastefull non-ready `Node`s being processed and
thus a large test runtime when e.g. simulating a gbit
connection (https://github.com/mozilla/neqo/pull/2203).
2024-12-08 22:21:00 +00:00
..
db Split crypto data if it cannot fit into a single packer. 2019-09-13 13:55:30 +02:00
src fix(sim): correct `Waiting` state comparison in `NodeHolder::ready()` (#2263) 2024-12-08 22:21:00 +00:00
Cargo.toml chore: Guard testing functions properly (#2264) 2024-12-03 15:27:29 +00:00