1
0
Fork 0
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:
Nayeem Rahman 2023-09-15 16:46:48 +01:00 committed by GitHub
parent d226970c0e
commit 11f0ccf805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View file

@ -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",
});

View file

@ -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])

View file

@ -0,0 +1,3 @@
Deno.test("test 11", () => {
throw new Error();
});

View file

@ -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(