deflake process.test.js

This commit is contained in:
Jarred Sumner
2024-12-04 13:47:44 -08:00
parent 55454f7910
commit 55a0bdc68d

View File

@@ -118,11 +118,15 @@ it("process.chdir() on root dir", () => {
}
});
it("process.hrtime()", () => {
it("process.hrtime()", async () => {
const start = process.hrtime();
const end = process.hrtime(start);
const end2 = process.hrtime();
expect(end[0]).toBe(0);
// Flaky on Ubuntu.
await Bun.sleep(0);
const end2 = process.hrtime();
expect(end2[1] > start[1]).toBe(true);
});