mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-05 06:43:10 +00:00
32 lines
1.1 KiB
Rust
32 lines
1.1 KiB
Rust
use std::time::Duration;
|
|
|
|
use testing_framework_core::scenario::ScenarioBuilder;
|
|
use testing_framework_workflows::{ChaosBuilderExt, ScenarioBuilderExt};
|
|
|
|
pub fn determinism_first() {
|
|
// Separate: functional test (deterministic)
|
|
let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1))
|
|
.transactions_with(|txs| {
|
|
txs.rate(5) // 5 transactions per block
|
|
})
|
|
.expect_consensus_liveness()
|
|
.build();
|
|
|
|
// Separate: chaos test (introduces randomness)
|
|
let _chaos_plan =
|
|
ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2))
|
|
.enable_node_control()
|
|
.chaos_with(|c| {
|
|
c.restart()
|
|
.min_delay(Duration::from_secs(30))
|
|
.max_delay(Duration::from_secs(60))
|
|
.target_cooldown(Duration::from_secs(45))
|
|
.apply()
|
|
})
|
|
.transactions_with(|txs| {
|
|
txs.rate(5) // 5 transactions per block
|
|
})
|
|
.expect_consensus_liveness()
|
|
.build();
|
|
}
|