Skip to content

Commit

Permalink
Connect partition flag to validators (#8622) (#8646)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
solana-grimes authored Mar 5, 2020
1 parent 14cba53 commit b3af1c7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ fn run_cluster_partition(
assert_eq!(node_stakes.len(), num_nodes);
let cluster_lamports = node_stakes.iter().sum::<u64>() * 2;
let partition_start_epoch = 2;
let enable_partition = Arc::new(AtomicBool::new(true));
let mut validator_config = ValidatorConfig::default();
validator_config.enable_partition = Some(enable_partition.clone());

// Returns:
// 1) The keys for the validiators
Expand Down Expand Up @@ -255,7 +257,6 @@ fn run_cluster_partition(
..ClusterConfig::default()
};

let enable_partition = Some(Arc::new(AtomicBool::new(true)));
info!(
"PARTITION_TEST starting cluster with {:?} partitions slots_per_epoch: {}",
partitions, config.slots_per_epoch,
Expand All @@ -282,10 +283,7 @@ fn run_cluster_partition(

if reached_epoch {
info!("PARTITION_TEST start partition");
enable_partition
.clone()
.unwrap()
.store(false, Ordering::Relaxed);
enable_partition.clone().store(false, Ordering::Relaxed);
break;
} else {
sleep(Duration::from_millis(100));
Expand All @@ -294,7 +292,7 @@ fn run_cluster_partition(
sleep(Duration::from_millis(leader_schedule_time));

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 alive_node_contact_infos = vec![];
Expand Down

0 comments on commit b3af1c7

Please sign in to comment.