Skip to content

Commit

Permalink
windows: patch setTimeout.test.js flakiness (#10564)
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro authored Apr 27, 2024
1 parent 8280def commit 9416ee4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/js/web/timers/setTimeout.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { spawnSync } from "bun";
import { it, expect } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { bunEnv, bunExe, isWindows } from "harness";
import path from "node:path";

const isWindows = process.platform === "win32";

it("setTimeout", async () => {
var lastID = -1;
const result = await new Promise((resolve, reject) => {
Expand Down Expand Up @@ -255,8 +253,11 @@ it("setTimeout should refresh N times", done => {

setTimeout(() => {
clearTimeout(timer);
expect(count).toBeGreaterThanOrEqual(5);
done();
try {
expect(count).toBeGreaterThanOrEqual(isWindows ? 4 : 5);
} finally {
done();
}
}, 300);
});

Expand Down

0 comments on commit 9416ee4

Please sign in to comment.