mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
fix(test): share fail fast tracker between threads (#20515)
This commit is contained in:
parent
d226970c0e
commit
11f0ccf805
4 changed files with 7 additions and 2 deletions
|
@ -182,7 +182,7 @@ itest!(quiet {
|
|||
});
|
||||
|
||||
itest!(fail_fast {
|
||||
args: "test --fail-fast test/fail_fast.ts",
|
||||
args: "test --fail-fast test/fail_fast.ts test/fail_fast_other.ts",
|
||||
exit_code: 1,
|
||||
output: "test/fail_fast.out",
|
||||
});
|
||||
|
|
1
cli/tests/testdata/test/fail_fast.out
vendored
1
cli/tests/testdata/test/fail_fast.out
vendored
|
@ -1,4 +1,5 @@
|
|||
Check [WILDCARD]/test/fail_fast.ts
|
||||
Check [WILDCARD]/test/fail_fast_other.ts
|
||||
running 10 tests from ./test/fail_fast.ts
|
||||
test 1 ... FAILED ([WILDCARD])
|
||||
|
||||
|
|
3
cli/tests/testdata/test/fail_fast_other.ts
vendored
Normal file
3
cli/tests/testdata/test/fail_fast_other.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
Deno.test("test 11", () => {
|
||||
throw new Error();
|
||||
});
|
|
@ -828,12 +828,13 @@ async fn test_specifiers(
|
|||
});
|
||||
HAS_TEST_RUN_SIGINT_HANDLER.store(true, Ordering::Relaxed);
|
||||
let mut reporter = get_test_reporter(&options);
|
||||
let fail_fast_tracker = FailFastTracker::new(options.fail_fast);
|
||||
|
||||
let join_handles = specifiers.into_iter().map(move |specifier| {
|
||||
let worker_factory = worker_factory.clone();
|
||||
let permissions = permissions.clone();
|
||||
let sender = sender.clone();
|
||||
let fail_fast_tracker = FailFastTracker::new(options.fail_fast);
|
||||
let fail_fast_tracker = fail_fast_tracker.clone();
|
||||
let specifier_options = options.specifier.clone();
|
||||
spawn_blocking(move || {
|
||||
create_and_run_current_thread(test_specifier(
|
||||
|
|
Loading…
Reference in a new issue