TestValidator now implements Drop, no need to close() it
This commit is contained in:
committed by
mergify[bot]
parent
0a9ff1dc9d
commit
bbad3fe501
@ -141,6 +141,4 @@ fn test_cli_deploy_program() {
|
|||||||
assert_eq!(account2.owner, bpf_loader::id());
|
assert_eq!(account2.owner, bpf_loader::id());
|
||||||
assert_eq!(account2.executable, true);
|
assert_eq!(account2.executable, true);
|
||||||
assert_eq!(account0.data, account2.data);
|
assert_eq!(account0.data, account2.data);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -210,8 +210,6 @@ fn full_battery_tests(
|
|||||||
check_recent_balance(1000, &rpc_client, &config_payer.signers[0].pubkey());
|
check_recent_balance(1000, &rpc_client, &config_payer.signers[0].pubkey());
|
||||||
check_recent_balance(800, &rpc_client, &nonce_account);
|
check_recent_balance(800, &rpc_client, &nonce_account);
|
||||||
check_recent_balance(200, &rpc_client, &payee_pubkey);
|
check_recent_balance(200, &rpc_client, &payee_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -333,6 +331,4 @@ fn test_create_account_with_seed() {
|
|||||||
check_recent_balance(31, &rpc_client, &offline_nonce_authority_signer.pubkey());
|
check_recent_balance(31, &rpc_client, &offline_nonce_authority_signer.pubkey());
|
||||||
check_recent_balance(4000, &rpc_client, &online_nonce_creator_signer.pubkey());
|
check_recent_balance(4000, &rpc_client, &online_nonce_creator_signer.pubkey());
|
||||||
check_recent_balance(10, &rpc_client, &to_address);
|
check_recent_balance(10, &rpc_client, &to_address);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,4 @@ fn test_cli_request_airdrop() {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.value;
|
.value;
|
||||||
assert_eq!(balance, 50);
|
assert_eq!(balance, 50);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,6 @@ fn test_stake_delegation_force() {
|
|||||||
fee_payer: 0,
|
fee_payer: 0,
|
||||||
};
|
};
|
||||||
process_command(&config).unwrap();
|
process_command(&config).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -189,8 +187,6 @@ fn test_seed_stake_delegation_and_deactivation() {
|
|||||||
fee_payer: 0,
|
fee_payer: 0,
|
||||||
};
|
};
|
||||||
process_command(&config_validator).unwrap();
|
process_command(&config_validator).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -266,8 +262,6 @@ fn test_stake_delegation_and_deactivation() {
|
|||||||
fee_payer: 0,
|
fee_payer: 0,
|
||||||
};
|
};
|
||||||
process_command(&config_validator).unwrap();
|
process_command(&config_validator).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -400,8 +394,6 @@ fn test_offline_stake_delegation_and_deactivation() {
|
|||||||
fee_payer: 0,
|
fee_payer: 0,
|
||||||
};
|
};
|
||||||
process_command(&config_payer).unwrap();
|
process_command(&config_payer).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -516,8 +508,6 @@ fn test_nonced_stake_delegation_and_deactivation() {
|
|||||||
fee_payer: 0,
|
fee_payer: 0,
|
||||||
};
|
};
|
||||||
process_command(&config).unwrap();
|
process_command(&config).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -789,8 +779,6 @@ fn test_stake_authorize() {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.blockhash;
|
.blockhash;
|
||||||
assert_ne!(nonce_hash, new_nonce_hash);
|
assert_ne!(nonce_hash, new_nonce_hash);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -916,8 +904,6 @@ fn test_stake_authorize_with_fee_payer() {
|
|||||||
// `config_offline` however has paid 1 sig due to being both authority
|
// `config_offline` however has paid 1 sig due to being both authority
|
||||||
// and fee payer
|
// and fee payer
|
||||||
check_recent_balance(100_000 - SIG_FEE, &rpc_client, &offline_pubkey);
|
check_recent_balance(100_000 - SIG_FEE, &rpc_client, &offline_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1061,8 +1047,6 @@ fn test_stake_split() {
|
|||||||
&rpc_client,
|
&rpc_client,
|
||||||
&split_account.pubkey(),
|
&split_account.pubkey(),
|
||||||
);
|
);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1324,8 +1308,6 @@ fn test_stake_set_lockup() {
|
|||||||
);
|
);
|
||||||
assert_eq!(current_lockup.epoch, lockup.epoch.unwrap());
|
assert_eq!(current_lockup.epoch, lockup.epoch.unwrap());
|
||||||
assert_eq!(current_lockup.custodian, offline_pubkey);
|
assert_eq!(current_lockup.custodian, offline_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1538,6 +1520,4 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
|
|||||||
let seed_address =
|
let seed_address =
|
||||||
Pubkey::create_with_seed(&stake_pubkey, seed, &solana_stake_program::id()).unwrap();
|
Pubkey::create_with_seed(&stake_pubkey, seed, &solana_stake_program::id()).unwrap();
|
||||||
check_recent_balance(50_000, &rpc_client, &seed_address);
|
check_recent_balance(50_000, &rpc_client, &seed_address);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -237,8 +237,6 @@ fn test_transfer() {
|
|||||||
process_command(&config).unwrap();
|
process_command(&config).unwrap();
|
||||||
check_recent_balance(28, &rpc_client, &offline_pubkey);
|
check_recent_balance(28, &rpc_client, &offline_pubkey);
|
||||||
check_recent_balance(40, &rpc_client, &recipient_pubkey);
|
check_recent_balance(40, &rpc_client, &recipient_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -358,8 +356,6 @@ fn test_transfer_multisession_signing() {
|
|||||||
check_recent_balance(1, &rpc_client, &offline_from_signer.pubkey());
|
check_recent_balance(1, &rpc_client, &offline_from_signer.pubkey());
|
||||||
check_recent_balance(1, &rpc_client, &offline_fee_payer_signer.pubkey());
|
check_recent_balance(1, &rpc_client, &offline_fee_payer_signer.pubkey());
|
||||||
check_recent_balance(42, &rpc_client, &to_pubkey);
|
check_recent_balance(42, &rpc_client, &to_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -405,6 +401,4 @@ fn test_transfer_all() {
|
|||||||
process_command(&config).unwrap();
|
process_command(&config).unwrap();
|
||||||
check_recent_balance(0, &rpc_client, &sender_pubkey);
|
check_recent_balance(0, &rpc_client, &sender_pubkey);
|
||||||
check_recent_balance(49_999, &rpc_client, &recipient_pubkey);
|
check_recent_balance(49_999, &rpc_client, &recipient_pubkey);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,4 @@ fn test_vote_authorize_and_withdraw() {
|
|||||||
withdraw_authority: 1,
|
withdraw_authority: 1,
|
||||||
};
|
};
|
||||||
process_command(&config).unwrap();
|
process_command(&config).unwrap();
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ use {
|
|||||||
rpc::JsonRpcConfig,
|
rpc::JsonRpcConfig,
|
||||||
validator::{Validator, ValidatorConfig},
|
validator::{Validator, ValidatorConfig},
|
||||||
},
|
},
|
||||||
|
solana_client::rpc_client::RpcClient,
|
||||||
solana_ledger::{blockstore::create_new_ledger, create_new_tmp_ledger},
|
solana_ledger::{blockstore::create_new_ledger, create_new_tmp_ledger},
|
||||||
solana_runtime::{
|
solana_runtime::{
|
||||||
bank_forks::{CompressionType, SnapshotConfig, SnapshotVersion},
|
bank_forks::{CompressionType, SnapshotConfig, SnapshotVersion},
|
||||||
@ -12,6 +13,8 @@ use {
|
|||||||
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
|
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
|
||||||
},
|
},
|
||||||
solana_sdk::{
|
solana_sdk::{
|
||||||
|
clock::DEFAULT_MS_PER_SLOT,
|
||||||
|
commitment_config::CommitmentConfig,
|
||||||
fee_calculator::FeeRateGovernor,
|
fee_calculator::FeeRateGovernor,
|
||||||
native_token::sol_to_lamports,
|
native_token::sol_to_lamports,
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
@ -23,6 +26,8 @@ use {
|
|||||||
net::SocketAddr,
|
net::SocketAddr,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
|
thread::sleep,
|
||||||
|
time::Duration,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -34,17 +39,19 @@ pub struct TestValidatorGenesisConfig {
|
|||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct TestValidatorStartConfig {
|
pub struct TestValidatorStartConfig {
|
||||||
|
pub preserve_ledger: bool,
|
||||||
pub rpc_config: JsonRpcConfig,
|
pub rpc_config: JsonRpcConfig,
|
||||||
pub rpc_ports: Option<(u16, u16)>, // (JsonRpc, JsonRpcPubSub), None == random ports
|
pub rpc_ports: Option<(u16, u16)>, // (JsonRpc, JsonRpcPubSub), None == random ports
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestValidator {
|
pub struct TestValidator {
|
||||||
ledger_path: PathBuf,
|
ledger_path: PathBuf,
|
||||||
|
preserve_ledger: bool,
|
||||||
rpc_pubsub_url: String,
|
rpc_pubsub_url: String,
|
||||||
rpc_url: String,
|
rpc_url: String,
|
||||||
tpu: SocketAddr,
|
tpu: SocketAddr,
|
||||||
gossip: SocketAddr,
|
gossip: SocketAddr,
|
||||||
validator: Validator,
|
validator: Option<Validator>,
|
||||||
vote_account_address: Pubkey,
|
vote_account_address: Pubkey,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +230,7 @@ impl TestValidator {
|
|||||||
..ValidatorConfig::default()
|
..ValidatorConfig::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let validator = Validator::new(
|
let validator = Some(Validator::new(
|
||||||
node,
|
node,
|
||||||
&Arc::new(validator_identity_keypair),
|
&Arc::new(validator_identity_keypair),
|
||||||
&ledger_path,
|
&ledger_path,
|
||||||
@ -231,7 +238,7 @@ impl TestValidator {
|
|||||||
vec![Arc::new(validator_vote_account)],
|
vec![Arc::new(validator_vote_account)],
|
||||||
None,
|
None,
|
||||||
&validator_config,
|
&validator_config,
|
||||||
);
|
));
|
||||||
|
|
||||||
// Needed to avoid panics in `solana-responder-gossip` in tests that create a number of
|
// Needed to avoid panics in `solana-responder-gossip` in tests that create a number of
|
||||||
// test validators concurrently...
|
// test validators concurrently...
|
||||||
@ -239,6 +246,7 @@ impl TestValidator {
|
|||||||
|
|
||||||
Ok(TestValidator {
|
Ok(TestValidator {
|
||||||
ledger_path: ledger_path.to_path_buf(),
|
ledger_path: ledger_path.to_path_buf(),
|
||||||
|
preserve_ledger: false,
|
||||||
rpc_pubsub_url,
|
rpc_pubsub_url,
|
||||||
rpc_url,
|
rpc_url,
|
||||||
gossip,
|
gossip,
|
||||||
@ -248,12 +256,6 @@ impl TestValidator {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop the test validator and delete its ledger directory
|
|
||||||
pub fn close(self) {
|
|
||||||
self.validator.close().unwrap();
|
|
||||||
remove_dir_all(&self.ledger_path).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Return the test validator's TPU address
|
/// Return the test validator's TPU address
|
||||||
pub fn tpu(&self) -> &SocketAddr {
|
pub fn tpu(&self) -> &SocketAddr {
|
||||||
&self.tpu
|
&self.tpu
|
||||||
@ -279,3 +281,20 @@ impl TestValidator {
|
|||||||
self.vote_account_address
|
self.vote_account_address
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for TestValidator {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
if let Some(validator) = self.validator.take() {
|
||||||
|
validator.close();
|
||||||
|
}
|
||||||
|
if !self.preserve_ledger {
|
||||||
|
remove_dir_all(&self.ledger_path).unwrap_or_else(|err| {
|
||||||
|
panic!(
|
||||||
|
"Failed to remove ledger directory {}: {}",
|
||||||
|
self.ledger_path.display(),
|
||||||
|
err
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -65,7 +65,7 @@ use std::{
|
|||||||
sync::atomic::{AtomicBool, Ordering},
|
sync::atomic::{AtomicBool, Ordering},
|
||||||
sync::mpsc::Receiver,
|
sync::mpsc::Receiver,
|
||||||
sync::{mpsc::channel, Arc, Mutex, RwLock},
|
sync::{mpsc::channel, Arc, Mutex, RwLock},
|
||||||
thread::{sleep, Result},
|
thread::sleep,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -635,9 +635,9 @@ impl Validator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn close(mut self) -> Result<()> {
|
pub fn close(mut self) {
|
||||||
self.exit();
|
self.exit();
|
||||||
self.join()
|
self.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_node_info(node: &Node) {
|
fn print_node_info(node: &Node) {
|
||||||
@ -665,7 +665,7 @@ impl Validator {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn join(self) -> Result<()> {
|
pub fn join(self) {
|
||||||
self.poh_service.join().expect("poh_service");
|
self.poh_service.join().expect("poh_service");
|
||||||
drop(self.poh_recorder);
|
drop(self.poh_recorder);
|
||||||
if let Some(RpcServices {
|
if let Some(RpcServices {
|
||||||
@ -718,8 +718,6 @@ impl Validator {
|
|||||||
.join()
|
.join()
|
||||||
.expect("completed_data_sets_service");
|
.expect("completed_data_sets_service");
|
||||||
self.ip_echo_server.shutdown_now();
|
self.ip_echo_server.shutdown_now();
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1267,7 +1265,7 @@ mod tests {
|
|||||||
Some(&leader_node.info),
|
Some(&leader_node.info),
|
||||||
&config,
|
&config,
|
||||||
);
|
);
|
||||||
validator.close().unwrap();
|
validator.close();
|
||||||
remove_dir_all(validator_ledger_path).unwrap();
|
remove_dir_all(validator_ledger_path).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1345,7 +1343,7 @@ mod tests {
|
|||||||
// While join 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
|
||||||
validators.into_iter().for_each(|validator| {
|
validators.into_iter().for_each(|validator| {
|
||||||
validator.join().unwrap();
|
validator.join();
|
||||||
});
|
});
|
||||||
|
|
||||||
for path in ledger_paths {
|
for path in ledger_paths {
|
||||||
|
@ -82,7 +82,6 @@ fn test_rpc_client() {
|
|||||||
client.get_balance(&alice.pubkey()).unwrap(),
|
client.get_balance(&alice.pubkey()).unwrap(),
|
||||||
original_alice_balance - sol_to_lamports(20.0)
|
original_alice_balance - sol_to_lamports(20.0)
|
||||||
);
|
);
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -109,7 +109,6 @@ fn test_rpc_send_tx() {
|
|||||||
);
|
);
|
||||||
let json: Value = post_rpc(req, &rpc_url);
|
let json: Value = post_rpc(req, &rpc_url);
|
||||||
info!("{:?}", json["result"]["value"]);
|
info!("{:?}", json["result"]["value"]);
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -142,7 +141,6 @@ fn test_rpc_invalid_requests() {
|
|||||||
|
|
||||||
let the_value = &json["result"]["value"];
|
let the_value = &json["result"]["value"];
|
||||||
assert!(the_value.is_null());
|
assert!(the_value.is_null());
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -317,5 +315,4 @@ fn test_rpc_subscriptions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rt.shutdown_now().wait().unwrap();
|
rt.shutdown_now().wait().unwrap();
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ impl LocalCluster {
|
|||||||
self.exit();
|
self.exit();
|
||||||
for (_, node) in self.validators.iter_mut() {
|
for (_, node) in self.validators.iter_mut() {
|
||||||
if let Some(v) = node.validator.take() {
|
if let Some(v) = node.validator.take() {
|
||||||
v.join().expect("Validator join failed");
|
v.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -609,7 +609,7 @@ impl Cluster for LocalCluster {
|
|||||||
// Shut down the validator
|
// Shut down the validator
|
||||||
let mut validator = node.validator.take().expect("Validator must be running");
|
let mut validator = node.validator.take().expect("Validator must be running");
|
||||||
validator.exit();
|
validator.exit();
|
||||||
validator.join().unwrap();
|
validator.join();
|
||||||
node
|
node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1063,8 +1063,6 @@ mod tests {
|
|||||||
|
|
||||||
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
||||||
test_process_distribute_tokens_with_client(&client, alice, None);
|
test_process_distribute_tokens_with_client(&client, alice, None);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1075,8 +1073,6 @@ mod tests {
|
|||||||
|
|
||||||
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
||||||
test_process_distribute_tokens_with_client(&client, alice, Some(sol_to_lamports(1.5)));
|
test_process_distribute_tokens_with_client(&client, alice, Some(sol_to_lamports(1.5)));
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1087,8 +1083,6 @@ mod tests {
|
|||||||
|
|
||||||
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
|
||||||
test_process_distribute_stake_with_client(&client, alice);
|
test_process_distribute_stake_with_client(&client, alice);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1477,8 +1471,6 @@ mod tests {
|
|||||||
} else {
|
} else {
|
||||||
panic!("check_payer_balances should have errored");
|
panic!("check_payer_balances should have errored");
|
||||||
}
|
}
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1550,8 +1542,6 @@ mod tests {
|
|||||||
} else {
|
} else {
|
||||||
panic!("check_payer_balances should have errored");
|
panic!("check_payer_balances should have errored");
|
||||||
}
|
}
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn initialize_stake_account(
|
fn initialize_stake_account(
|
||||||
@ -1699,8 +1689,6 @@ mod tests {
|
|||||||
} else {
|
} else {
|
||||||
panic!("check_payer_balances should have errored");
|
panic!("check_payer_balances should have errored");
|
||||||
}
|
}
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1779,8 +1767,6 @@ mod tests {
|
|||||||
} else {
|
} else {
|
||||||
panic!("check_payer_balances should have errored");
|
panic!("check_payer_balances should have errored");
|
||||||
}
|
}
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -2076,8 +2062,6 @@ mod tests {
|
|||||||
let read_db = db::open_db(&db_file, true).unwrap();
|
let read_db = db::open_db(&db_file, true).unwrap();
|
||||||
let transaction_info = db::read_transaction_infos(&read_db);
|
let transaction_info = db::read_transaction_infos(&read_db);
|
||||||
assert_eq!(transaction_info.len(), 1);
|
assert_eq!(transaction_info.len(), 1);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -12,6 +12,4 @@ fn test_process_distribute_with_rpc_client() {
|
|||||||
|
|
||||||
let client = RpcClient::new(test_validator.rpc_url());
|
let client = RpcClient::new(test_validator.rpc_url());
|
||||||
test_process_distribute_tokens_with_client(&client, mint_keypair, None);
|
test_process_distribute_tokens_with_client(&client, mint_keypair, None);
|
||||||
|
|
||||||
test_validator.close();
|
|
||||||
}
|
}
|
||||||
|
@ -206,6 +206,7 @@ fn main() {
|
|||||||
TestValidator::start(
|
TestValidator::start(
|
||||||
&ledger_path,
|
&ledger_path,
|
||||||
TestValidatorStartConfig {
|
TestValidatorStartConfig {
|
||||||
|
preserve_ledger: true,
|
||||||
rpc_config: JsonRpcConfig {
|
rpc_config: JsonRpcConfig {
|
||||||
enable_validator_exit: true,
|
enable_validator_exit: true,
|
||||||
enable_rpc_transaction_history: true,
|
enable_rpc_transaction_history: true,
|
||||||
|
@ -1740,6 +1740,6 @@ pub fn main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
info!("Validator initialized");
|
info!("Validator initialized");
|
||||||
validator.join().expect("validator exit");
|
validator.join();
|
||||||
info!("Validator exiting..");
|
info!("Validator exiting..");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user