Revert "fix(test): Improve reliability of deno test's op sanitizer with timers (#12908)" (#12929)

This reverts commit d335343a79.
This commit is contained in:
Bartek Iwańczuk 2021-11-29 12:07:47 +01:00 committed by GitHub
parent 6c09e02304
commit 5178e093ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 67 deletions

View file

@ -151,11 +151,6 @@ itest!(ops_sanitizer_unstable {
output: "test/ops_sanitizer_unstable.out",
});
itest!(ops_sanitizer_timeout_failure {
args: "test test/ops_sanitizer_timeout_failure.ts",
output: "test/ops_sanitizer_timeout_failure.out",
});
itest!(exit_sanitizer {
args: "test test/exit_sanitizer.ts",
output: "test/exit_sanitizer.out",

View file

@ -1,6 +0,0 @@
Check [WILDCARD]/testdata/test/ops_sanitizer_timeout_failure.ts
running 1 test from [WILDCARD]/testdata/test/ops_sanitizer_timeout_failure.ts
test wait ... ok ([WILDCARD])
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

View file

@ -1,22 +0,0 @@
let intervalHandle: number;
let firstIntervalPromise: Promise<void>;
addEventListener("load", () => {
firstIntervalPromise = new Promise((resolve) => {
let firstIntervalCalled = false;
intervalHandle = setInterval(() => {
if (!firstIntervalCalled) {
resolve();
firstIntervalCalled = true;
}
}, 5);
});
});
addEventListener("unload", () => {
clearInterval(intervalHandle);
});
Deno.test("wait", async function () {
await firstIntervalPromise;
});