@ -217,7 +217,9 @@ fn run_cluster_partition(
|
|||||||
assert_eq!(node_stakes.len(), num_nodes);
|
assert_eq!(node_stakes.len(), num_nodes);
|
||||||
let cluster_lamports = node_stakes.iter().sum::<u64>() * 2;
|
let cluster_lamports = node_stakes.iter().sum::<u64>() * 2;
|
||||||
let partition_start_epoch = 2;
|
let partition_start_epoch = 2;
|
||||||
|
let enable_partition = Arc::new(AtomicBool::new(true));
|
||||||
let mut validator_config = ValidatorConfig::default();
|
let mut validator_config = ValidatorConfig::default();
|
||||||
|
validator_config.enable_partition = Some(enable_partition.clone());
|
||||||
|
|
||||||
// Returns:
|
// Returns:
|
||||||
// 1) The keys for the validiators
|
// 1) The keys for the validiators
|
||||||
@ -255,7 +257,6 @@ fn run_cluster_partition(
|
|||||||
..ClusterConfig::default()
|
..ClusterConfig::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let enable_partition = Some(Arc::new(AtomicBool::new(true)));
|
|
||||||
info!(
|
info!(
|
||||||
"PARTITION_TEST starting cluster with {:?} partitions slots_per_epoch: {}",
|
"PARTITION_TEST starting cluster with {:?} partitions slots_per_epoch: {}",
|
||||||
partitions, config.slots_per_epoch,
|
partitions, config.slots_per_epoch,
|
||||||
@ -282,10 +283,7 @@ fn run_cluster_partition(
|
|||||||
|
|
||||||
if reached_epoch {
|
if reached_epoch {
|
||||||
info!("PARTITION_TEST start partition");
|
info!("PARTITION_TEST start partition");
|
||||||
enable_partition
|
enable_partition.clone().store(false, Ordering::Relaxed);
|
||||||
.clone()
|
|
||||||
.unwrap()
|
|
||||||
.store(false, Ordering::Relaxed);
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
sleep(Duration::from_millis(100));
|
sleep(Duration::from_millis(100));
|
||||||
@ -294,7 +292,7 @@ fn run_cluster_partition(
|
|||||||
sleep(Duration::from_millis(leader_schedule_time));
|
sleep(Duration::from_millis(leader_schedule_time));
|
||||||
|
|
||||||
info!("PARTITION_TEST remove partition");
|
info!("PARTITION_TEST remove partition");
|
||||||
enable_partition.unwrap().store(true, Ordering::Relaxed);
|
enable_partition.store(true, Ordering::Relaxed);
|
||||||
|
|
||||||
let mut dead_nodes = HashSet::new();
|
let mut dead_nodes = HashSet::new();
|
||||||
let mut alive_node_contact_infos = vec![];
|
let mut alive_node_contact_infos = vec![];
|
||||||
|
Reference in New Issue
Block a user