Skip to content

Commit

Permalink
Fix flaky process.cpuUsage tests (#13842)
Browse files Browse the repository at this point in the history
  • Loading branch information
190n authored Sep 10, 2024
1 parent c7b8744 commit 2071507
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/js/node/process/process.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,11 @@ describe("process.cpuUsage", () => {
// Skipped on Windows because it seems UV returns { user: 15000, system: 0 } constantly
it.skipIf(process.platform === "win32")("works with diff", () => {
const init = process.cpuUsage();
init.system = 1;
init.user = 1;
init.system = 0;
init.user = 0;
const delta = process.cpuUsage(init);
expect(delta.user).toBeGreaterThan(0);
expect(delta.system).toBeGreaterThan(0);
expect(delta.system).toBeGreaterThanOrEqual(0);
});

it.skipIf(process.platform === "win32")("works with diff of different structure", () => {
Expand All @@ -458,7 +458,7 @@ describe("process.cpuUsage", () => {
};
const delta = process.cpuUsage(init);
expect(delta.user).toBeGreaterThan(0);
expect(delta.system).toBeGreaterThan(0);
expect(delta.system).toBeGreaterThanOrEqual(0);
});

it("throws on invalid property", () => {
Expand Down

0 comments on commit 2071507

Please sign in to comment.