chore: fix flaky tests checking ms when CI is slow (#18559)

This commit is contained in:
David Sherret 2023-04-06 17:48:07 -04:00 committed by GitHub
parent df72420d72
commit 1586c52b5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 31 deletions

View file

@ -5,7 +5,7 @@ test ...
------- output -------
test
----- output end -----
test ... ok ([WILDCARD]ms)
test ... ok ([WILDCARD]s)
ok | 1 passed | 0 failed ([WILDCARD]s)

View file

@ -1,5 +1,5 @@
running 1 test from ./test/no_prompt_by_default.ts
no prompt ... FAILED ([WILDCARD]ms)
no prompt ... FAILED ([WILDCARD]s)
ERRORS
@ -11,6 +11,6 @@ error: PermissionDenied: Requires read access to "./some_file.txt", run again wi
no prompt => ./test/no_prompt_by_default.ts:[WILDCARD]
FAILED | 0 passed | 1 failed ([WILDCARD]ms)
FAILED | 0 passed | 1 failed ([WILDCARD]s)
error: Test failed

View file

@ -1,5 +1,5 @@
running 1 test from ./test/no_prompt_with_denied_perms.ts
no prompt ... FAILED ([WILDCARD]ms)
no prompt ... FAILED ([WILDCARD]s)
ERRORS
@ -11,6 +11,6 @@ error: PermissionDenied: Requires read access to "./some_file.txt", run again wi
no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD]
FAILED | 0 passed | 1 failed ([WILDCARD]ms)
FAILED | 0 passed | 1 failed ([WILDCARD]s)
error: Test failed

View file

@ -1,23 +1,23 @@
Check [WILDCARD]/test/parallel_output.ts
./test/parallel_output.ts => step output ... step 1 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step output ... step 2 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step output ... step 1 ... ok ([WILDCARD]s)
./test/parallel_output.ts => step output ... step 2 ... ok ([WILDCARD]s)
------- output -------
Hello, world! (from step 3)
----- output end -----
./test/parallel_output.ts => step output ... step 3 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step output ... step 3 ... ok ([WILDCARD]s)
------- output -------
Hello, world! (from step 4)
----- output end -----
./test/parallel_output.ts => step output ... step 4 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step output ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step failures ... step 1 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step failures ... step 2 ... FAILED ([WILDCARD]ms)
./test/parallel_output.ts => step failures ... step 3 ... FAILED ([WILDCARD]ms)
./test/parallel_output.ts => step failures ... FAILED (due to 2 failed steps) ([WILDCARD]ms)
./test/parallel_output.ts => step nested failure ... step 1 ... inner 1 ... ok ([WILDCARD]ms)
./test/parallel_output.ts => step nested failure ... step 1 ... inner 2 ... FAILED ([WILDCARD]ms)
./test/parallel_output.ts => step nested failure ... step 1 ... FAILED (due to 1 failed step) ([WILDCARD]ms)
./test/parallel_output.ts => step nested failure ... FAILED (due to 1 failed step) ([WILDCARD]ms)
./test/parallel_output.ts => step output ... step 4 ... ok ([WILDCARD]s)
./test/parallel_output.ts => step output ... ok ([WILDCARD]s)
./test/parallel_output.ts => step failures ... step 1 ... ok ([WILDCARD]s)
./test/parallel_output.ts => step failures ... step 2 ... FAILED ([WILDCARD]s)
./test/parallel_output.ts => step failures ... step 3 ... FAILED ([WILDCARD]s)
./test/parallel_output.ts => step failures ... FAILED (due to 2 failed steps) ([WILDCARD]s)
./test/parallel_output.ts => step nested failure ... step 1 ... inner 1 ... ok ([WILDCARD]s)
./test/parallel_output.ts => step nested failure ... step 1 ... inner 2 ... FAILED ([WILDCARD]s)
./test/parallel_output.ts => step nested failure ... step 1 ... FAILED (due to 1 failed step) ([WILDCARD]s)
./test/parallel_output.ts => step nested failure ... FAILED (due to 1 failed step) ([WILDCARD]s)
ERRORS
@ -51,6 +51,6 @@ step failures ... step 2 => ./test/parallel_output.ts:14:11
step failures ... step 3 => ./test/parallel_output.ts:17:11
step nested failure ... step 1 ... inner 2 => ./test/parallel_output.ts:23:13
FAILED | 1 passed (6 steps) | 2 failed (4 steps) ([WILDCARD]ms)
FAILED | 1 passed (6 steps) | 2 failed (4 steps) ([WILDCARD]s)
error: Test failed

View file

@ -12,18 +12,18 @@ description ...
------- output -------
3
----- output end -----
inner 1 ... ok ([WILDCARD]ms)
inner 1 ... ok ([WILDCARD]s)
inner 2 ...
------- output -------
4
----- output end -----
inner 2 ... ok ([WILDCARD]ms)
inner 2 ... ok ([WILDCARD]s)
------- output -------
5
----- output end -----
step 1 ... ok ([WILDCARD]ms)
step 1 ... ok ([WILDCARD]s)
------- output -------
6
----- output end -----
description ... ok ([WILDCARD]ms)
description ... ok ([WILDCARD]s)
[WILDCARD]

View file

@ -2,16 +2,16 @@
running 6 tests from ./test/steps/passing_steps.ts
description ...
step 1 ...
inner 1 ... ok ([WILDCARD]ms)
inner 2 ... ok ([WILDCARD]ms)
step 1 ... ok ([WILDCARD]ms)
description ... ok ([WILDCARD]ms)
inner 1 ... ok ([WILDCARD]s)
inner 2 ... ok ([WILDCARD]s)
step 1 ... ok ([WILDCARD]s)
description ... ok ([WILDCARD]s)
description function as first arg ...
step1 ...
inner1 ... ok ([WILDCARD]ms)
inner1 ... ok ([WILDCARD]ms)
step1 ... ok ([WILDCARD]ms)
description function as first arg ... ok ([WILDCARD]ms)
inner1 ... ok ([WILDCARD]s)
inner1 ... ok ([WILDCARD]s)
step1 ... ok ([WILDCARD]s)
description function as first arg ... ok ([WILDCARD]s)
parallel steps without sanitizers ...
step 1 ... ok ([WILDCARD])
step 2 ... ok ([WILDCARD])

View file

@ -650,6 +650,7 @@ impl PrettyTestReporter {
failures_by_origin.entry(origin.clone()).or_default();
let _ = uncaught_error.insert(js_error.as_ref());
}
// note: the trailing whitespace is intentional to get a red background
println!("\n{}\n", colors::white_bold_on_red(" ERRORS "));
for (origin, (failures, uncaught_error)) in failures_by_origin {
for (description, failure) in failures {
@ -678,6 +679,7 @@ impl PrettyTestReporter {
failure_titles.push(failure_title);
}
}
// note: the trailing whitespace is intentional to get a red background
println!("{}\n", colors::white_bold_on_red(" FAILURES "));
for failure_title in failure_titles {
println!("{failure_title}");