Skip to content

Commit 8323f6e

Browse files
authored
reduce success criteria for ha proxy, increase for long running (aptos-labs#9037)
Co-authored-by: Igor <[email protected]>
1 parent 6358f8b commit 8323f6e

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

testsuite/forge-cli/src/main.rs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn main() -> Result<()> {
238238
// cmd input for test
239239
CliCommand::Test(ref test_cmd) => {
240240
// Identify the test suite to run
241-
let mut test_suite = get_test_suite(suite_name, duration)?;
241+
let mut test_suite = get_test_suite(suite_name, duration, test_cmd)?;
242242

243243
// Identify the number of validators and fullnodes to run
244244
// (if overriding what test has specified)
@@ -445,15 +445,19 @@ fn get_changelog(prev_commit: Option<&String>, upstream_commit: &str) -> String
445445
}
446446
}
447447

448-
fn get_test_suite(suite_name: &str, duration: Duration) -> Result<ForgeConfig> {
448+
fn get_test_suite(
449+
suite_name: &str,
450+
duration: Duration,
451+
test_cmd: &TestCommand,
452+
) -> Result<ForgeConfig> {
449453
match suite_name {
450454
"local_test_suite" => Ok(local_test_suite()),
451455
"pre_release" => Ok(pre_release_suite()),
452456
"run_forever" => Ok(run_forever()),
453457
// TODO(rustielin): verify each test suite
454458
"k8s_suite" => Ok(k8s_test_suite()),
455459
"chaos" => Ok(chaos_test_suite(duration)),
456-
single_test => single_test_suite(single_test, duration),
460+
single_test => single_test_suite(single_test, duration, test_cmd),
457461
}
458462
}
459463

@@ -486,11 +490,15 @@ fn k8s_test_suite() -> ForgeConfig {
486490
.add_network_test(PerformanceBenchmark)
487491
}
488492

489-
fn single_test_suite(test_name: &str, duration: Duration) -> Result<ForgeConfig> {
493+
fn single_test_suite(
494+
test_name: &str,
495+
duration: Duration,
496+
test_cmd: &TestCommand,
497+
) -> Result<ForgeConfig> {
490498
let single_test_suite = match test_name {
491499
// Land-blocking tests to be run on every PR:
492500
"land_blocking" => land_blocking_test_suite(duration), // to remove land_blocking, superseeded by the below
493-
"realistic_env_max_load" => realistic_env_max_load_test(duration),
501+
"realistic_env_max_load" => realistic_env_max_load_test(duration, test_cmd),
494502
"compat" => compat(),
495503
"framework_upgrade" => upgrade(),
496504
// Rest of the tests:
@@ -1455,8 +1463,14 @@ fn land_blocking_test_suite(duration: Duration) -> ForgeConfig {
14551463
}
14561464

14571465
// TODO: Replace land_blocking when performance reaches on par with current land_blocking
1458-
fn realistic_env_max_load_test(duration: Duration) -> ForgeConfig {
1466+
fn realistic_env_max_load_test(duration: Duration, test_cmd: &TestCommand) -> ForgeConfig {
1467+
let ha_proxy = if let TestCommand::K8sSwarm(k8s) = test_cmd {
1468+
k8s.enable_haproxy
1469+
} else {
1470+
false
1471+
};
14591472
let duration_secs = duration.as_secs();
1473+
let long_running = duration_secs >= 2400;
14601474
ForgeConfig::default()
14611475
.with_initial_validator_count(NonZeroUsize::new(20).unwrap())
14621476
.with_initial_fullnode_count(10)
@@ -1466,12 +1480,20 @@ fn realistic_env_max_load_test(duration: Duration) -> ForgeConfig {
14661480
mempool_backlog: 40000,
14671481
})
14681482
.init_gas_price_multiplier(20),
1469-
inner_success_criteria: SuccessCriteria::new(5000),
1483+
inner_success_criteria: SuccessCriteria::new(
1484+
if ha_proxy {
1485+
4700
1486+
} else if long_running {
1487+
5500
1488+
} else {
1489+
5000
1490+
},
1491+
),
14701492
}))
14711493
.with_genesis_helm_config_fn(Arc::new(move |helm_values| {
14721494
// Have single epoch change in land blocking, and a few on long-running
14731495
helm_values["chain"]["epoch_duration_secs"] =
1474-
(if duration_secs >= 1800 { 600 } else { 300 }).into();
1496+
(if long_running { 600 } else { 300 }).into();
14751497
}))
14761498
// First start higher gas-fee traffic, to not cause issues with TxnEmitter setup - account creation
14771499
.with_emit_job(

0 commit comments

Comments
 (0)