diff options
| author | Luca Casonato <hello@lcas.dev> | 2023-09-14 16:38:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-14 16:38:15 +0200 |
| commit | 851f795001a9164572d02606587ddc5193bdfd2d (patch) | |
| tree | 77a129ff766013dd9ea0cb83d6a84a40e4f1f0f7 /cli/tests/testdata/test | |
| parent | bbb348aa33b56e15f376e8e7ee7b71bd5badd936 (diff) | |
fix: output traces for op sanitizer in more cases (#20494)
This adds traces for the "started outside test, closed inside test"
case.
Diffstat (limited to 'cli/tests/testdata/test')
| -rw-r--r-- | cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.out | 19 | ||||
| -rw-r--r-- | cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.ts | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.out b/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.out new file mode 100644 index 000000000..37fb0a319 --- /dev/null +++ b/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.out @@ -0,0 +1,19 @@ +Check [WILDCARD]test/ops_sanitizer_closed_inside_started_before.ts +running 1 test from ./test/ops_sanitizer_closed_inside_started_before.ts +test 1 ... FAILED [WILDCARD] + + ERRORS + +test 1 => ./test/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] +error: Leaking async ops: + - 1 async operation to sleep for a duration was started before this test, but was completed during the test. Async operations should not complete in a test if they were not started in that test. This is often caused by not cancelling a `setTimeout` or `setInterval` call. The operation was started here: + at [WILDCARD] + at [WILDCARD]/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] + + FAILURES + +test 1 => ./test/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] + +FAILED | 0 passed | 1 failed [WILDCARD] + +error: Test failed diff --git a/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.ts b/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.ts new file mode 100644 index 000000000..97d3d72c8 --- /dev/null +++ b/cli/tests/testdata/test/ops_sanitizer_closed_inside_started_before.ts @@ -0,0 +1,5 @@ +const timer = setTimeout(() => {}, 10000000000); + +Deno.test("test 1", () => { + clearTimeout(timer); +}); |
