diff options
Diffstat (limited to 'cli/tests/testdata')
4 files changed, 34 insertions, 56 deletions
diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out index 1981a2500..acab794ab 100644 --- a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out @@ -6,45 +6,35 @@ test test 2 ... FAILED ([WILDCARD]) failures: test 1 -AssertionError: Test case is leaking async ops. -Before: - - dispatched: 0 - - completed: 0 -After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] -Ops: - op_sleep: - Before: - - dispatched: 0 - - completed: 0 - After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] - -Make sure to await all promises returned from Deno APIs before -finishing test case. +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. The operations were started here: + at [WILDCARD] + at setTimeout ([WILDCARD]) + at test ([WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:4:3) + at [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:8:27 + at [WILDCARD] + + at [WILDCARD] + at setTimeout ([WILDCARD]) + at test ([WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:5:3) + at [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:8:27 at [WILDCARD] test 2 -AssertionError: Test case is leaking async ops. -Before: - - dispatched: [WILDCARD] - - completed: [WILDCARD] -After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] -Ops: - op_sleep: - Before: - - dispatched: [WILDCARD] - - completed: [WILDCARD] - After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] - -Make sure to await all promises returned from Deno APIs before -finishing test case. +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. The operations were started here: + at [WILDCARD] + at setTimeout ([WILDCARD]) + at test ([WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:4:3) + at [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:10:27 + at [WILDCARD] + + at [WILDCARD] + at setTimeout ([WILDCARD]) + at test ([WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:5:3) + at [WILDCARD]/testdata/test/ops_sanitizer_multiple_timeout_tests.ts:10:27 at [WILDCARD] failures: diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts index f30773cf2..1f52d481f 100644 --- a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts @@ -5,6 +5,6 @@ function test() { setTimeout(() => {}, 10001); } -Deno.test("test 1", test); +Deno.test("test 1", () => test()); -Deno.test("test 2", test); +Deno.test("test 2", () => test()); diff --git a/cli/tests/testdata/test/ops_sanitizer_unstable.out b/cli/tests/testdata/test/ops_sanitizer_unstable.out index 9d6a903e1..84ea10501 100644 --- a/cli/tests/testdata/test/ops_sanitizer_unstable.out +++ b/cli/tests/testdata/test/ops_sanitizer_unstable.out @@ -6,24 +6,12 @@ test leak interval ... FAILED ([WILDCARD]) failures: leak interval -AssertionError: Test case is leaking async ops. -Before: - - dispatched: 1 - - completed: 1 -After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] -Ops: - op_sleep: - Before: - - dispatched: 1 - - completed: 1 - After: - - dispatched: [WILDCARD] - - completed: [WILDCARD] +Test case is leaking async ops. -Make sure to await all promises returned from Deno APIs before -finishing test case. +- 1 async operation to sleep for a duration was started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call. The operation was started here: + at [WILDCARD] + at setInterval ([WILDCARD]) + at [WILDCARD]/testdata/test/ops_sanitizer_unstable.ts:3:3 at [WILDCARD] failures: diff --git a/cli/tests/testdata/test/ops_sanitizer_unstable.ts b/cli/tests/testdata/test/ops_sanitizer_unstable.ts index 92f7bb888..4f409e73c 100644 --- a/cli/tests/testdata/test/ops_sanitizer_unstable.ts +++ b/cli/tests/testdata/test/ops_sanitizer_unstable.ts @@ -1,4 +1,4 @@ Deno.test("no-op", function () {}); Deno.test("leak interval", function () { - setInterval(function () {}); + setInterval(function () {}, 100000); }); |