Skip to content

Commit 5fe78fd

Browse files
committed
test: improve stability of scheduler test
1 parent e639129 commit 5fe78fd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

denops/fall/lib/scheduler_test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Deno.test("Scheduler", async (t) => {
66
await t.step(
77
"calls the given asynchronous callback function with the given interval without overlapping",
88
async () => {
9-
const controller = new AbortController();
10-
const { signal } = controller;
119
let count = 0;
1210
let locked = false;
1311
{
@@ -17,16 +15,15 @@ Deno.test("Scheduler", async (t) => {
1715
throw new Error("Overlapping");
1816
}
1917
locked = true;
20-
await delay(100, { signal });
18+
await delay(100);
2119
count++;
2220
locked = false;
2321
});
24-
await delay(900);
22+
await delay(950);
2523
}
26-
controller.abort();
2724
// ```
2825
// Count 1 2 3 4
29-
// -------->=========|--------->=========|--------->=========|--------->=========|---------x
26+
// -------->=========|--------->=========|--------->=========|--------->=========|--------->====x
3027
// Time 100 200 300 400 500 600 700 800 900
3128
// ```
3229
assertEquals(count, 4);

0 commit comments

Comments
 (0)