summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-02-25 16:14:46 +0100
committerGitHub <noreply@github.com>2022-02-25 16:14:46 +0100
commitd332bf113259f65e90b18b543f19def248e38daa (patch)
treeed842487aa4f903d50bbb45d8ed2b5292257eda7 /cli/tests
parent111c343281b559ea51fd66c2ddc260549406a822 (diff)
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.
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/test_tests.rs10
-rw-r--r--cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out29
2 files changed, 37 insertions, 2 deletions
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