#![expect(
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
reason = "stress-test harness: intentional wide→narrow conversions for RNG bounds, metric buckets, and log formatting"
)]
#[path = "stress_test/mod.rs"]
mod stress_test;
use stress_test::config::{SimDataFormat, SimTransport, SimulationConfig};
use stress_test::simulation;
use std::path::PathBuf;
#[test]
#[ignore = "long-running stress test; opt-in via `cargo test -- --ignored`"]
fn stress_test_tcp_hyperbinary() {
let mut config = SimulationConfig::from_env();
config.transport = SimTransport::Tcp;
config.data_format = SimDataFormat::HyperBinary;
let summary = simulation::run(config);
assert!(
!summary.hyper_crashed,
"Hyper process crashed during stress test"
);
}
#[test]
#[ignore = "long-running stress test; opt-in via `cargo test -- --ignored`"]
fn stress_test_tcp_arrow() {
let mut config = SimulationConfig::from_env();
config.transport = SimTransport::Tcp;
config.data_format = SimDataFormat::ArrowStream;
let summary = simulation::run(config);
assert!(
!summary.hyper_crashed,
"Hyper process crashed during stress test"
);
}
#[test]
#[ignore = "long-running stress test; opt-in via `cargo test -- --ignored`"]
fn stress_test_grpc() {
let mut config = SimulationConfig::from_env();
config.transport = SimTransport::Grpc;
config.data_format = SimDataFormat::HyperBinary;
let summary = simulation::run(config);
assert!(
!summary.hyper_crashed,
"Hyper process crashed during stress test"
);
}
#[test]
#[ignore = "long-running stress test; opt-in via `cargo test -- --ignored`"]
fn stress_test_replay() {
let replay_path = std::env::var("STRESS_REPLAY_FILE")
.expect("STRESS_REPLAY_FILE env var must be set for replay mode");
let summary = simulation::run_replay(&PathBuf::from(replay_path));
assert!(
!summary.hyper_crashed,
"Hyper process crashed during stress test replay"
);
}