From 1586c52b5b5ad511ec0bf896e94de8585f743cf8 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 6 Apr 2023 17:48:07 -0400 Subject: [PATCH] chore: fix flaky tests checking ms when CI is slow (#18559) --- cli/tests/testdata/npm/esm/test.out | 2 +- .../testdata/test/no_prompt_by_default.out | 4 +-- .../test/no_prompt_with_denied_perms.out | 4 +-- cli/tests/testdata/test/parallel_output.out | 28 +++++++++---------- .../testdata/test/steps/output_within.out | 8 +++--- .../testdata/test/steps/passing_steps.out | 16 +++++------ cli/tools/test.rs | 2 ++ 7 files changed, 33 insertions(+), 31 deletions(-) diff --git a/cli/tests/testdata/npm/esm/test.out b/cli/tests/testdata/npm/esm/test.out index cc196501db..a879244248 100644 --- a/cli/tests/testdata/npm/esm/test.out +++ b/cli/tests/testdata/npm/esm/test.out @@ -5,7 +5,7 @@ test ... ------- output ------- test ----- output end ----- -test ... ok ([WILDCARD]ms) +test ... ok ([WILDCARD]s) ok | 1 passed | 0 failed ([WILDCARD]s) diff --git a/cli/tests/testdata/test/no_prompt_by_default.out b/cli/tests/testdata/test/no_prompt_by_default.out index eaab16ce83..a35e3f7aed 100644 --- a/cli/tests/testdata/test/no_prompt_by_default.out +++ b/cli/tests/testdata/test/no_prompt_by_default.out @@ -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 diff --git a/cli/tests/testdata/test/no_prompt_with_denied_perms.out b/cli/tests/testdata/test/no_prompt_with_denied_perms.out index 4d683b2d84..4293ff1bb2 100644 --- a/cli/tests/testdata/test/no_prompt_with_denied_perms.out +++ b/cli/tests/testdata/test/no_prompt_with_denied_perms.out @@ -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 diff --git a/cli/tests/testdata/test/parallel_output.out b/cli/tests/testdata/test/parallel_output.out index f5c9321718..d3528a6e0b 100644 --- a/cli/tests/testdata/test/parallel_output.out +++ b/cli/tests/testdata/test/parallel_output.out @@ -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 diff --git a/cli/tests/testdata/test/steps/output_within.out b/cli/tests/testdata/test/steps/output_within.out index 34d94b6f8b..d58722daa5 100644 --- a/cli/tests/testdata/test/steps/output_within.out +++ b/cli/tests/testdata/test/steps/output_within.out @@ -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] diff --git a/cli/tests/testdata/test/steps/passing_steps.out b/cli/tests/testdata/test/steps/passing_steps.out index 231a9a1708..0757a4ed36 100644 --- a/cli/tests/testdata/test/steps/passing_steps.out +++ b/cli/tests/testdata/test/steps/passing_steps.out @@ -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]) diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 28364050ef..fa9798779c 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -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}");