diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-02-20 01:43:23 +0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-02-19 13:29:31 -0800 |
commit | 5c9b37bb4838a501bbe4379f7d59ba7f82098d58 (patch) | |
tree | 87b40a6240df14d2855c87bf13988da6d3d79cd0 | |
parent | a32c57453674617f454035fe206d8e93ec4aef33 (diff) | |
download | android-node-v8-5c9b37bb4838a501bbe4379f7d59ba7f82098d58.tar.gz android-node-v8-5c9b37bb4838a501bbe4379f7d59ba7f82098d58.tar.bz2 android-node-v8-5c9b37bb4838a501bbe4379f7d59ba7f82098d58.zip |
process: move test-process-uptime to parallel
In addition, do not make too many assumptions about the startup
time and timer latency in test-process-uptime. Instead only test
that the value is likely in the correct unit (seconds) and it should
be increasing in subsequent calls.
PR-URL: https://github.com/nodejs/node/pull/26206
Fixes: https://github.com/nodejs/node/issues/26205
Refs: https://github.com/nodejs/node/pull/26016
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
-rw-r--r-- | test/parallel/test-process-uptime.js (renamed from test/pummel/test-process-uptime.js) | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/pummel/test-process-uptime.js b/test/parallel/test-process-uptime.js index 781066371e..eabb6cf266 100644 --- a/test/pummel/test-process-uptime.js +++ b/test/parallel/test-process-uptime.js @@ -24,14 +24,14 @@ require('../common'); const assert = require('assert'); console.error(process.uptime()); -assert.ok(process.uptime() <= 2); +// Add some wiggle room for different platforms. +// Verify that the returned value is in seconds - +// 15 seconds should be a good estimate. +assert.ok(process.uptime() <= 15); const original = process.uptime(); setTimeout(function() { const uptime = process.uptime(); - // some wiggle room to account for timer - // granularity, processor speed, and scheduling - assert.ok(uptime >= original + 2); - assert.ok(uptime <= original + 3); -}, 2000); + assert.ok(original < uptime); +}, 10); |