Skip to content

Commit 6f59914

Browse files
authored
Turbopack: run more unit tests in multi thread runtime (#82889)
### What? We want to run all unit tests in multi thread runtime, otherwise they would panic on block_in_place.
1 parent 0ed99f1 commit 6f59914

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

crates/next-api/src/nft_json.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ mod tests {
431431
}
432432
}
433433

434-
#[tokio::test]
434+
#[tokio::test(flavor = "multi_thread")]
435435
async fn test_relativize_glob_normal_patterns() {
436436
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
437437
BackendOptions::default(),
@@ -458,7 +458,7 @@ mod tests {
458458
.unwrap();
459459
}
460460

461-
#[tokio::test]
461+
#[tokio::test(flavor = "multi_thread")]
462462
async fn test_relativize_glob_current_directory_prefix() {
463463
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
464464
BackendOptions::default(),
@@ -487,7 +487,7 @@ mod tests {
487487
.unwrap();
488488
}
489489

490-
#[tokio::test]
490+
#[tokio::test(flavor = "multi_thread")]
491491
async fn test_relativize_glob_parent_directory_navigation() {
492492
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
493493
BackendOptions::default(),
@@ -517,7 +517,7 @@ mod tests {
517517
.unwrap();
518518
}
519519

520-
#[tokio::test]
520+
#[tokio::test(flavor = "multi_thread")]
521521
async fn test_relativize_glob_mixed_prefixes() {
522522
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
523523
BackendOptions::default(),
@@ -547,7 +547,7 @@ mod tests {
547547
.unwrap();
548548
}
549549

550-
#[tokio::test]
550+
#[tokio::test(flavor = "multi_thread")]
551551
async fn test_relativize_glob_error_navigation_out_of_root() {
552552
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
553553
BackendOptions::default(),

turbopack/crates/turbo-tasks-fs/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ mod tests {
24232423
);
24242424
}
24252425

2426-
#[tokio::test]
2426+
#[tokio::test(flavor = "multi_thread")]
24272427
async fn with_extension() {
24282428
crate::register();
24292429

@@ -2460,7 +2460,7 @@ mod tests {
24602460
.unwrap()
24612461
}
24622462

2463-
#[tokio::test]
2463+
#[tokio::test(flavor = "multi_thread")]
24642464
async fn file_stem() {
24652465
crate::register();
24662466

turbopack/crates/turbo-tasks-fs/src/read_glob.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub mod tests {
240240
DirectoryEntry, DiskFileSystem, FileContent, FileSystem, FileSystemPath, glob::Glob,
241241
};
242242

243-
#[tokio::test]
243+
#[tokio::test(flavor = "multi_thread")]
244244
async fn read_glob_basic() {
245245
crate::register();
246246
let scratch = tempfile::tempdir().unwrap();
@@ -304,7 +304,7 @@ pub mod tests {
304304
}
305305

306306
#[cfg(unix)]
307-
#[tokio::test]
307+
#[tokio::test(flavor = "multi_thread")]
308308
async fn read_glob_symlinks() {
309309
crate::register();
310310
let scratch = tempfile::tempdir().unwrap();
@@ -407,7 +407,7 @@ pub mod tests {
407407
}
408408

409409
#[cfg(unix)]
410-
#[tokio::test]
410+
#[tokio::test(flavor = "multi_thread")]
411411
async fn track_glob_invalidations() {
412412
use std::os::unix::fs::symlink;
413413
crate::register();
@@ -494,7 +494,7 @@ pub mod tests {
494494
}
495495

496496
#[cfg(unix)]
497-
#[tokio::test]
497+
#[tokio::test(flavor = "multi_thread")]
498498
async fn track_glob_symlinks_loop() {
499499
crate::register();
500500
let scratch = tempfile::tempdir().unwrap();
@@ -552,7 +552,7 @@ pub mod tests {
552552
}
553553

554554
#[cfg(unix)]
555-
#[tokio::test]
555+
#[tokio::test(flavor = "multi_thread")]
556556
async fn read_glob_symlinks_loop() {
557557
crate::register();
558558
let scratch = tempfile::tempdir().unwrap();

turbopack/crates/turbo-tasks-macros-tests/tests/task_input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn one_unnamed_field(input: OneUnnamedField) -> Vc<Completion> {
1818
Completion::immutable()
1919
}
2020

21-
#[tokio::test]
21+
#[tokio::test(flavor = "multi_thread")]
2222
async fn tests() {
2323
run(&REGISTRATION, || async {
2424
assert!(ReadRef::ptr_eq(

turbopack/crates/turbo-tasks-macros-tests/tests/value_debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use turbo_tasks_testing::{Registration, register, run};
55

66
static REGISTRATION: Registration = register!();
77

8-
#[tokio::test]
8+
#[tokio::test(flavor = "multi_thread")]
99
async fn ignored_indexes() {
1010
#[allow(dead_code)]
1111
#[derive(ValueDebugFormat)]

turbopack/crates/turbopack-core/src/module_graph/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ pub mod tests {
18771877
resolve::ExportUsage,
18781878
};
18791879

1880-
#[tokio::test]
1880+
#[tokio::test(flavor = "multi_thread")]
18811881
async fn traverse_dfs_from_entries_diamond() {
18821882
run_graph_test(
18831883
vec![rcstr!("a.js")],
@@ -1939,7 +1939,7 @@ pub mod tests {
19391939
.await;
19401940
}
19411941

1942-
#[tokio::test]
1942+
#[tokio::test(flavor = "multi_thread")]
19431943
async fn traverse_dfs_from_entries_cycle() {
19441944
run_graph_test(
19451945
vec![rcstr!("a.js")],
@@ -1999,7 +1999,7 @@ pub mod tests {
19991999
.await;
20002000
}
20012001

2002-
#[tokio::test]
2002+
#[tokio::test(flavor = "multi_thread")]
20032003
async fn traverse_edges_from_entries_fixed_point_cycle() {
20042004
run_graph_test(
20052005
vec![rcstr!("a.js")],

turbopack/crates/turbopack-dev-server/src/update/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ pub mod test {
425425
ResolveSourceRequestResult::NotFound.cell()
426426
}
427427

428-
#[tokio::test]
428+
#[tokio::test(flavor = "multi_thread")]
429429
async fn test_get_content_fn() {
430430
crate::register();
431431
let tt = TurboTasks::new(TurboTasksBackend::new(

turbopack/crates/turbopack/src/module_options/rule_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub mod tests {
240240

241241
use super::*;
242242

243-
#[tokio::test]
243+
#[tokio::test(flavor = "multi_thread")]
244244
async fn test_rule_condition_leaves() {
245245
crate::register();
246246
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(
@@ -374,7 +374,7 @@ pub mod tests {
374374
anyhow::Ok(())
375375
}
376376

377-
#[tokio::test]
377+
#[tokio::test(flavor = "multi_thread")]
378378
async fn test_rule_condition_tree() {
379379
crate::register();
380380
let tt = turbo_tasks::TurboTasks::new(TurboTasksBackend::new(

0 commit comments

Comments
 (0)