-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Andreu Botella
authored
Dec 7, 2021
1 parent
5027826
commit 33da15a
Showing
8 changed files
with
456 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
10 changes: 10 additions & 0 deletions
10
cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.