Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! Reduce expected precision
  • Loading branch information
TimothyGu committed Mar 4, 2018
commit 497b54d5a94d768afc44f6611f0a8fc3ba9d4da8
8 changes: 5 additions & 3 deletions test/parallel/test-performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ const { performance } = require('perf_hooks');
assert(performance);
assert(performance.nodeTiming);
assert.strictEqual(typeof performance.timeOrigin, 'number');
assert(Math.abs(performance.timeOrigin - Date.now()) < 300);
// Use a fairly large epsilon value, since we can only guarantee that the node
// process started up in 20 seconds.
assert(Math.abs(performance.timeOrigin - Date.now()) < 20000);

const inited = performance.now();
assert(inited < 300);
assert(inited < 20000);

{
const entries = performance.getEntries();
Expand Down Expand Up @@ -113,7 +115,7 @@ function checkNodeTiming(props) {
if (props[prop].around !== undefined) {
assert.strictEqual(typeof performance.nodeTiming[prop], 'number');
const delta = performance.nodeTiming[prop] - props[prop].around;
assert(Math.abs(delta) < 500);
assert(Math.abs(delta) < 1000);
} else {
assert.strictEqual(performance.nodeTiming[prop], props[prop]);
}
Expand Down