mirror of
https://github.com/denoland/deno.git
synced 2024-12-14 19:37:59 -05:00
430b63c2c4
This commit improves async op sanitizer speed by only delaying metrics collection if there are pending ops. This results in a speedup of around 30% for small CPU bound unit tests. It performs this check and possible delay on every collection now, fixing an issue with parent test leaks into steps.
10 lines
280 B
TypeScript
10 lines
280 B
TypeScript
Deno.test("timeout", async (t) => {
|
|
const timer = setTimeout(() => {
|
|
console.log("timeout");
|
|
}, 10000);
|
|
clearTimeout(timer);
|
|
await t.step("step", async () => {
|
|
await new Promise<void>((resolve) => setTimeout(() => resolve(), 10));
|
|
});
|
|
console.log("done");
|
|
});
|