Skip to content

Commit 9d84641

Browse files
nickstanishMylesBorins
authored andcommitted
test: fix conversion of microseconds in test
PR-URL: #14706 Fixes: #8728 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
1 parent 28b77d1 commit 9d84641

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/pummel/test-process-cpuUsage.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ while (Date.now() - now < RUN_FOR_MS);
1717
// Get a diff reading from when we started.
1818
const diff = process.cpuUsage(start);
1919

20-
const MICROSECONDS_PER_SECOND = 1000 * 1000;
20+
const MICROSECONDS_PER_MILLISECOND = 1000;
2121

2222
// Diff usages should be >= 0, <= ~RUN_FOR_MS millis.
2323
// Let's be generous with the slop factor, defined above, in case other things
2424
// are happening on this CPU. The <= check may be invalid if the node process
2525
// is making use of multiple CPUs, in which case, just remove it.
2626
assert(diff.user >= 0);
27-
assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND);
27+
assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND);
2828

2929
assert(diff.system >= 0);
30-
assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND);
30+
assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND);

0 commit comments

Comments
 (0)