diff options
| author | tv <tv@krebsco.de> | 2026-10-31 05:26:27 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 05:26:27 +0100 |
| commit | 3de2af786cee9d6841bc12c0e46c1d9c6a1c5024 (patch) | |
| tree | 7b211ef765c7320d427a64d2a4ddbd831de7f7ae /src/simtest | |
| parent | 1e7207b0575f59dc16a4b2fd9a92b793ff3541f8 (diff) | |
simtest: unify SOON constant
Diffstat (limited to 'src/simtest')
| -rw-r--r-- | src/simtest/deltas.rs | 3 | ||||
| -rw-r--r-- | src/simtest/mod.rs | 3 | ||||
| -rw-r--r-- | src/simtest/remakes.rs | 4 | ||||
| -rw-r--r-- | src/simtest/timing.rs | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/src/simtest/deltas.rs b/src/simtest/deltas.rs index ce74607..84497ac 100644 --- a/src/simtest/deltas.rs +++ b/src/simtest/deltas.rs @@ -9,12 +9,11 @@ use std::time::Duration; use serde_json::json; -use super::{Sim, read, write}; +use super::{SOON, Sim, read, write}; use crate::node::NodeConfig; use crate::state::AppState; use crate::swarm::bootstrap::Start; -const SOON: Duration = Duration::from_secs(10); /// Catching up a few hundred KiB in 1 KiB chunks. const CATCH_UP: Duration = Duration::from_secs(60); const CHUNK: u32 = 1024; diff --git a/src/simtest/mod.rs b/src/simtest/mod.rs index e6ee7a7..3c73bee 100644 --- a/src/simtest/mod.rs +++ b/src/simtest/mod.rs @@ -44,6 +44,9 @@ pub(crate) const SYNC_REPLY_TIMEOUT: Duration = Duration::from_secs(1); /// How long the simulated net may take to deliver a message: well above its delays. /// A catch-up source that stops sending sync messages is given up after this. pub(crate) const DELIVERY_LIMIT: Duration = Duration::from_secs(3); +/// How long tests wait for what should happen within a few keepalives: joining, +/// registering, converging. +pub(crate) const SOON: Duration = Duration::from_secs(10); /// A simulated swarm: the net and the nodes started on it. pub(crate) struct Sim { diff --git a/src/simtest/remakes.rs b/src/simtest/remakes.rs index 28f3768..e4f115b 100644 --- a/src/simtest/remakes.rs +++ b/src/simtest/remakes.rs @@ -10,15 +10,13 @@ use std::time::Duration; use axum::http::StatusCode; use serde_json::{Value as JsonValue, json}; -use super::{Sim, read, write}; +use super::{SOON, Sim, read, write}; use crate::document::replica::Epoch; use crate::remake::testing; use crate::state::AppState; use crate::swarm::bootstrap::Start; use crate::transport::sim::LinkParams; -/// Joining, registering and converging. -const SOON: Duration = Duration::from_secs(10); /// A remake from proposal to every node switched, rejoins included. const REMAKE: Duration = Duration::from_secs(30); diff --git a/src/simtest/timing.rs b/src/simtest/timing.rs index 0f19313..fd76a17 100644 --- a/src/simtest/timing.rs +++ b/src/simtest/timing.rs @@ -5,15 +5,13 @@ use std::time::Duration; use serde_json::json; -use super::{Sim, has_neighbour, heads, peer, read, write}; +use super::{SOON, Sim, has_neighbour, heads, peer, read, write}; use crate::document::replica::Epoch; use crate::state::AppState; use crate::swarm::bootstrap::Start; use crate::transport::sim::LinkParams; use crate::transport::{HeadsSummary, HelloRequest, MessageKind, ParsedMessage, RunId, Status}; -/// Long enough for anything that should happen within a few keepalives. -const SOON: Duration = Duration::from_secs(10); /// With lost messages: several reply timeouts (1 s, doubling) and heals in a row. const LOSSY: Duration = Duration::from_secs(30); |
