From d332bf113259f65e90b18b543f19def248e38daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 25 Feb 2022 16:14:46 +0100 Subject: feat: deno test --trace-ops (#13770) This commit adds "--trace-ops" flag to "deno test" subcommand. This flag enables saving of stack traces for async ops, that before were always saved. While the feature proved to be very useful it comes with a significant performance hit, it's caused by excessive source mapping of stack frames. --- cli/tests/integration/test_tests.rs | 10 ++++++-- ...s_sanitizer_multiple_timeout_tests_no_trace.out | 29 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out (limited to 'cli/tests') diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index 0697fc69c..c80406935 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -146,7 +146,7 @@ itest!(allow_none { }); itest!(ops_sanitizer_unstable { - args: "test --unstable test/ops_sanitizer_unstable.ts", + args: "test --unstable --trace-ops test/ops_sanitizer_unstable.ts", exit_code: 1, output: "test/ops_sanitizer_unstable.out", }); @@ -157,11 +157,17 @@ itest!(ops_sanitizer_timeout_failure { }); itest!(ops_sanitizer_multiple_timeout_tests { - args: "test test/ops_sanitizer_multiple_timeout_tests.ts", + args: "test --trace-ops test/ops_sanitizer_multiple_timeout_tests.ts", exit_code: 1, output: "test/ops_sanitizer_multiple_timeout_tests.out", }); +itest!(ops_sanitizer_multiple_timeout_tests_no_trace { + args: "test test/ops_sanitizer_multiple_timeout_tests.ts", + exit_code: 1, + output: "test/ops_sanitizer_multiple_timeout_tests_no_trace.out", +}); + itest!(ops_sanitizer_nexttick { args: "test test/ops_sanitizer_nexttick.ts", output: "test/ops_sanitizer_nexttick.out", diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out new file mode 100644 index 000000000..9dad65525 --- /dev/null +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out @@ -0,0 +1,29 @@ +Check [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts +running 2 tests from [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts +test test 1 ... FAILED ([WILDCARD]) +test test 2 ... FAILED ([WILDCARD]) + +failures: + +test 1 +Test case is leaking async ops. + +- 2 async operations to sleep for a duration were started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call. + +To get more details where ops were leaked, run again with --trace-ops flag. + +test 2 +Test case is leaking async ops. + +- 2 async operations to sleep for a duration were started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call. + +To get more details where ops were leaked, run again with --trace-ops flag. + +failures: + + test 1 + test 2 + +test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + +error: Test failed -- cgit v1.2.3