diff options
| author | Andreu Botella <abb@randomunok.com> | 2021-12-07 13:39:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-07 13:39:58 +0100 |
| commit | 33da15ae5aa1b454d1a73eb5fbc3135927122988 (patch) | |
| tree | 92bd8c024b4cabc32337a6169808e64d1f814819 /cli/tests/testdata | |
| parent | 5027826a6407c96a973155be0620b458ab74d974 (diff) | |
refactor(timers): refactor timers to use one async op per timer (#12862)
This change also makes the timers implementation closer to the spec, and
sets up the stage to implement AbortSignal.timeout() (whatwg/dom#1032).
Fixes #8965
Fixes #10974
Fixes #11398
Diffstat (limited to 'cli/tests/testdata')
4 files changed, 73 insertions, 6 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 new file mode 100644 index 000000000..1981a2500 --- /dev/null +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out @@ -0,0 +1,57 @@ +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 +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. + 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. + at [WILDCARD] + +failures: + + test 1 + test 2 + +test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + +error: Test failed diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts new file mode 100644 index 000000000..f30773cf2 --- /dev/null +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts @@ -0,0 +1,10 @@ +// https://github.com/denoland/deno/issues/8965 + +function test() { + setTimeout(() => {}, 10000); + setTimeout(() => {}, 10001); +} + +Deno.test("test 1", 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 3faea472b..9d6a903e1 100644 --- a/cli/tests/testdata/test/ops_sanitizer_unstable.out +++ b/cli/tests/testdata/test/ops_sanitizer_unstable.out @@ -11,16 +11,16 @@ Before: - dispatched: 1 - completed: 1 After: - - dispatched: 3 - - completed: 2 + - dispatched: [WILDCARD] + - completed: [WILDCARD] Ops: - op_global_timer: + op_sleep: Before: - dispatched: 1 - completed: 1 After: - - dispatched: 3 - - completed: 2 + - dispatched: [WILDCARD] + - completed: [WILDCARD] Make sure to await all promises returned from Deno APIs before finishing test case. diff --git a/cli/tests/testdata/worker_drop_handle_race.js.out b/cli/tests/testdata/worker_drop_handle_race.js.out index 271e07854..b7218e8f6 100644 --- a/cli/tests/testdata/worker_drop_handle_race.js.out +++ b/cli/tests/testdata/worker_drop_handle_race.js.out @@ -2,7 +2,7 @@ error: Uncaught (in worker "") Error throw new Error(); ^ at [WILDCARD]/workers/drop_handle_race.js:2:9 - at fire (deno:ext/timers/[WILDCARD]) + at Object.action (deno:ext/timers/[WILDCARD]) at handleTimerMacrotask (deno:ext/timers/[WILDCARD]) error: Uncaught (in promise) Error: Unhandled error event in child worker. at Worker.#pollControl (deno:runtime/js/11_workers.js:[WILDCARD]) |
