Skip to content

Commit 7572f05

Browse files
authored
Use 2 threads in tests with async TestValidator (solana-labs#6349)
use 2 threads in tests with async TestValidator
1 parent 4c21ac9 commit 7572f05

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

rpc-test/tests/nonblocking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use {
1313
tokio::time::{sleep, Duration, Instant},
1414
};
1515

16-
#[tokio::test]
16+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
1717
async fn test_tpu_send_transaction() {
1818
let (test_validator, mint_keypair) = TestValidatorGenesis::default().start_async().await;
1919
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
@@ -47,7 +47,7 @@ async fn test_tpu_send_transaction() {
4747
tpu_client.shutdown().await;
4848
}
4949

50-
#[tokio::test]
50+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
5151
async fn test_tpu_cache_slot_updates() {
5252
let (test_validator, _) = TestValidatorGenesis::default().start_async().await;
5353
let rpc_client = Arc::new(test_validator.get_async_rpc_client());

test-validator/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,22 +1194,22 @@ mod test {
11941194
rpc_client.get_health().expect("health");
11951195
}
11961196

1197-
#[tokio::test]
1197+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
11981198
async fn nonblocking_get_health() {
11991199
let (test_validator, _payer) = TestValidatorGenesis::default().start_async().await;
12001200
test_validator.set_startup_verification_complete_for_tests();
12011201
let rpc_client = test_validator.get_async_rpc_client();
12021202
rpc_client.get_health().await.expect("health");
12031203
}
12041204

1205-
#[tokio::test]
1205+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
12061206
#[should_panic]
12071207
async fn document_tokio_panic() {
12081208
// `start()` blows up when run within tokio
12091209
let (_test_validator, _payer) = TestValidatorGenesis::default().start();
12101210
}
12111211

1212-
#[tokio::test]
1212+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
12131213
async fn test_deactivate_features() {
12141214
let mut control = FeatureSet::default().inactive().clone();
12151215
let mut deactivate_features = Vec::new();
@@ -1253,7 +1253,7 @@ mod test {
12531253
}
12541254
}
12551255

1256-
#[tokio::test]
1256+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
12571257
async fn test_override_feature_account() {
12581258
let with_deactivate_flag = agave_feature_set::deprecate_rewards_sysvar::id();
12591259
let without_deactivate_flag = agave_feature_set::disable_fees_sysvar::id();
@@ -1291,7 +1291,7 @@ mod test {
12911291
assert!(feature_state.activated_at.is_some());
12921292
}
12931293

1294-
#[tokio::test]
1294+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
12951295
async fn test_core_bpf_programs() {
12961296
let (test_validator, _payer) = TestValidatorGenesis::default()
12971297
.deactivate_features(&[

0 commit comments

Comments
 (0)