review comments

This commit is contained in:
Anatoly Yakovenko
2018-07-17 11:45:52 -07:00
committed by Greg Fitzgerald
parent 9e2f26a5d2
commit 3d45b04da8
2 changed files with 8 additions and 6 deletions

View File

@ -347,6 +347,7 @@ mod tests {
use crdt::TestNode; use crdt::TestNode;
use fullnode::FullNode; use fullnode::FullNode;
use mint::Mint; use mint::Mint;
use service::Service;
use signature::{KeyPair, KeyPairUtil}; use signature::{KeyPair, KeyPairUtil};
use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicBool;
use std::sync::Arc; use std::sync::Arc;
@ -360,7 +361,7 @@ mod tests {
let entry = tn.data.clone(); let entry = tn.data.clone();
let v = FullNode::new_validator(kp, bank, 0, None, tn, &entry, exit); let v = FullNode::new_validator(kp, bank, 0, None, tn, &entry, exit);
v.exit(); v.exit();
v.close().unwrap(); v.join().unwrap();
} }
#[test] #[test]
fn validator_parallel_exit() { fn validator_parallel_exit() {
@ -375,10 +376,10 @@ mod tests {
FullNode::new_validator(kp, bank, 0, None, tn, &entry, exit) FullNode::new_validator(kp, bank, 0, None, tn, &entry, exit)
}) })
.collect(); .collect();
//each validator can exit in parallel to speed many sequential calls to `close` //each validator can exit in parallel to speed many sequential calls to `join`
vals.iter().for_each(|v| v.exit()); vals.iter().for_each(|v| v.exit());
//while close is called sequentially, the above exit call notified all the //while join is called sequentially, the above exit call notified all the
//validators to exit from all their threads //validators to exit from all their threads
vals.into_iter().for_each(|v| v.close().unwrap()); vals.into_iter().for_each(|v| v.join().unwrap());
} }
} }

View File

@ -11,6 +11,7 @@ use solana::fullnode::{FullNode, LedgerFile};
use solana::logger; use solana::logger;
use solana::mint::Mint; use solana::mint::Mint;
use solana::ncp::Ncp; use solana::ncp::Ncp;
use solana::service::Service;
use solana::signature::{KeyPair, KeyPairUtil, PublicKey}; use solana::signature::{KeyPair, KeyPairUtil, PublicKey};
use solana::streamer::default_window; use solana::streamer::default_window;
use solana::thin_client::ThinClient; use solana::thin_client::ThinClient;
@ -469,9 +470,9 @@ fn test_multi_node_dynamic_network() {
} }
server.exit(); server.exit();
for (_, node) in validators { for (_, node) in validators {
node.close().unwrap(); node.join().unwrap();
} }
server.close().unwrap(); server.join().unwrap();
std::fs::remove_file(ledger_path).unwrap(); std::fs::remove_file(ledger_path).unwrap();
} }