Skip to content

Commit f4053d2

Browse files
committed
Convert tokio to multithreaded
1 parent 6b1cb78 commit f4053d2

File tree

7 files changed

+21
-30
lines changed

7 files changed

+21
-30
lines changed

.github/actions/setup/action.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ runs:
8686
version: ${{ env.SOLANA_VERSION }}
8787
cache: true
8888

89-
- name: Cache APT packages for CLI dependencies
90-
if: ${{ inputs.cli == 'true' }}
91-
uses: actions/cache@v4
92-
with:
93-
path: /var/cache/apt/archives
94-
key: ${{ runner.os }}-apt-cache-${{ hashFiles('.github/actions/setup/action.yml') }}
95-
restore-keys: |
96-
${{ runner.os }}-apt-cache-
97-
9889
- name: Install CLI dependencies
9990
if: ${{ inputs.cli == 'true' }}
10091
shell: bash

clients/cli/tests/test_close_stuck_escrow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {
1919

2020
mod helpers;
2121

22-
#[tokio::test]
22+
#[tokio::test(flavor = "multi_thread")]
2323
#[serial]
2424
async fn test_only_token_2022_allowed() {
2525
let env = setup_test_env().await;
@@ -46,7 +46,7 @@ async fn test_only_token_2022_allowed() {
4646
assert!(stderr.contains("CloseStuckEscrow only works with spl-token-2022 unwrapped mints"));
4747
}
4848

49-
#[tokio::test]
49+
#[tokio::test(flavor = "multi_thread")]
5050
#[serial]
5151
async fn test_create_mint_close_stuck_escrow_fails() {
5252
let env = setup_test_env().await;
@@ -86,7 +86,7 @@ async fn test_create_mint_close_stuck_escrow_fails() {
8686
assert!(!output.status.success());
8787
}
8888

89-
#[tokio::test]
89+
#[tokio::test(flavor = "multi_thread")]
9090
#[serial]
9191
async fn test_successful_close() {
9292
let env = setup_test_env().await;

clients/cli/tests/test_create_escrow_account.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async fn assert_escrow_creation(
5959
assert_eq!(account_state.base.amount, 0.into());
6060
}
6161

62-
#[tokio::test]
62+
#[tokio::test(flavor = "multi_thread")]
6363
#[serial]
6464
async fn test_create_ata_escrow_account_for_spl_token_mint() {
6565
let env = setup_test_env().await;
@@ -99,7 +99,7 @@ async fn test_create_ata_escrow_account_for_spl_token_mint() {
9999
.await;
100100
}
101101

102-
#[tokio::test]
102+
#[tokio::test(flavor = "multi_thread")]
103103
#[serial]
104104
async fn test_create_ata_escrow_account_for_token2022_mint() {
105105
let env = setup_test_env().await;
@@ -139,7 +139,7 @@ async fn test_create_ata_escrow_account_for_token2022_mint() {
139139
.await;
140140
}
141141

142-
#[tokio::test]
142+
#[tokio::test(flavor = "multi_thread")]
143143
#[serial]
144144
async fn test_create_escrow_account_with_signer() {
145145
let env = setup_test_env().await;
@@ -192,7 +192,7 @@ async fn test_create_escrow_account_with_signer() {
192192
.await;
193193
}
194194

195-
#[tokio::test]
195+
#[tokio::test(flavor = "multi_thread")]
196196
#[serial]
197197
async fn test_create_escrow_account_signer_idempotent() {
198198
let env = setup_test_env().await;
@@ -241,7 +241,7 @@ async fn test_create_escrow_account_signer_idempotent() {
241241
.contains(format!("Escrow account {} already exists", derived_escrow_address).as_str()));
242242
}
243243

244-
#[tokio::test]
244+
#[tokio::test(flavor = "multi_thread")]
245245
#[serial]
246246
async fn test_create_escrow_account_ata_idempotent() {
247247
let env = setup_test_env().await;
@@ -284,7 +284,7 @@ async fn test_create_escrow_account_ata_idempotent() {
284284
assert!(stderr_c.contains("already exists"));
285285
}
286286

287-
#[tokio::test]
287+
#[tokio::test(flavor = "multi_thread")]
288288
#[serial]
289289
async fn test_create_escrow_account_with_wrong_mint_owner() {
290290
let env = setup_test_env().await;
@@ -310,7 +310,7 @@ async fn test_create_escrow_account_with_wrong_mint_owner() {
310310
assert!(stderr.contains("is not owned by a token program"));
311311
}
312312

313-
#[tokio::test]
313+
#[tokio::test(flavor = "multi_thread")]
314314
#[serial]
315315
async fn test_create_escrow_account_with_wrong_account_type() {
316316
let env = setup_test_env().await;

clients/cli/tests/test_create_mint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use {
1111

1212
mod helpers;
1313

14-
#[tokio::test]
14+
#[tokio::test(flavor = "multi_thread")]
1515
#[serial]
1616
async fn test_create_mint() {
1717
let env = setup_test_env().await;

clients/cli/tests/test_pdas.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use {
1010

1111
pub mod helpers;
1212

13-
#[tokio::test]
13+
#[tokio::test(flavor = "multi_thread")]
1414
#[serial]
1515
async fn test_pdas() {
1616
let env = setup_test_env().await;

clients/cli/tests/test_unwrap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async fn assert_unwrap_result(
164164
);
165165
}
166166

167-
#[tokio::test]
167+
#[tokio::test(flavor = "multi_thread")]
168168
#[serial]
169169
async fn test_unwrap_single_signer_with_defaults() {
170170
let env = setup_test_env().await;
@@ -201,7 +201,7 @@ async fn test_unwrap_single_signer_with_defaults() {
201201
.await;
202202
}
203203

204-
#[tokio::test]
204+
#[tokio::test(flavor = "multi_thread")]
205205
#[serial]
206206
async fn test_unwrap_single_signer_with_optional_flags() {
207207
let env = setup_test_env().await;
@@ -264,7 +264,7 @@ async fn test_unwrap_single_signer_with_optional_flags() {
264264
.await;
265265
}
266266

267-
#[tokio::test]
267+
#[tokio::test(flavor = "multi_thread")]
268268
#[serial]
269269
async fn test_unwrap_fail_invalid_wrapped_token_program() {
270270
let env = setup_test_env().await;
@@ -301,7 +301,7 @@ async fn test_unwrap_fail_invalid_wrapped_token_program() {
301301
)));
302302
}
303303

304-
#[tokio::test]
304+
#[tokio::test(flavor = "multi_thread")]
305305
#[serial]
306306
async fn test_unwrap_fail_mismatched_unwrapped_mint() {
307307
let env = setup_test_env().await;
@@ -338,7 +338,7 @@ async fn test_unwrap_fail_mismatched_unwrapped_mint() {
338338
)));
339339
}
340340

341-
#[tokio::test]
341+
#[tokio::test(flavor = "multi_thread")]
342342
#[serial]
343343
async fn test_unwrap_fail_invalid_unwrapped_token_program() {
344344
let env = setup_test_env().await;
@@ -376,7 +376,7 @@ async fn test_unwrap_fail_invalid_unwrapped_token_program() {
376376
)));
377377
}
378378

379-
#[tokio::test]
379+
#[tokio::test(flavor = "multi_thread")]
380380
#[serial]
381381
async fn test_unwrap_with_multisig() {
382382
let mut env = setup_test_env().await;

clients/cli/tests/test_wrap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use {
1717

1818
mod helpers;
1919

20-
#[tokio::test]
20+
#[tokio::test(flavor = "multi_thread")]
2121
#[serial]
2222
async fn test_wrap_single_signer_with_defaults() {
2323
let env = setup_test_env().await;
@@ -93,7 +93,7 @@ async fn test_wrap_single_signer_with_defaults() {
9393
.await;
9494
}
9595

96-
#[tokio::test]
96+
#[tokio::test(flavor = "multi_thread")]
9797
#[serial]
9898
async fn test_wrap_single_signer_with_optional_flags() {
9999
let env = setup_test_env().await;
@@ -222,7 +222,7 @@ async fn assert_result(
222222
assert_eq!(u64::from(wrapped_token_state.base.amount), wrap_amount);
223223
}
224224

225-
#[tokio::test]
225+
#[tokio::test(flavor = "multi_thread")]
226226
#[serial]
227227
async fn test_wrap_with_multisig() {
228228
let mut env = setup_test_env().await;

0 commit comments

Comments
 (0)