summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Stanish <nickstanish@gmail.com>2017-08-08 22:48:47 -0500
committerRich Trott <rtrott@gmail.com>2017-08-09 20:08:23 -0700
commita439cf4354c4781c7ac0026c7f69f7160e8439fb (patch)
tree29985de56ca18d1a6e0b24ead2de3e78f4c73900 /test
parentb72e702247a4dcbbb9d678253dad2b9b223459f4 (diff)
downloadandroid-node-v8-a439cf4354c4781c7ac0026c7f69f7160e8439fb.tar.gz
android-node-v8-a439cf4354c4781c7ac0026c7f69f7160e8439fb.tar.bz2
android-node-v8-a439cf4354c4781c7ac0026c7f69f7160e8439fb.zip
test: fix conversion of microseconds in test
PR-URL: https://github.com/nodejs/node/pull/14706 Fixes: https://github.com/nodejs/node/issues/8728 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/pummel/test-process-cpuUsage.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/pummel/test-process-cpuUsage.js b/test/pummel/test-process-cpuUsage.js
index 20b2fadef9..1d5aa861b6 100644
--- a/test/pummel/test-process-cpuUsage.js
+++ b/test/pummel/test-process-cpuUsage.js
@@ -17,14 +17,14 @@ while (Date.now() - now < RUN_FOR_MS);
// Get a diff reading from when we started.
const diff = process.cpuUsage(start);
-const MICROSECONDS_PER_SECOND = 1000 * 1000;
+const MICROSECONDS_PER_MILLISECOND = 1000;
// Diff usages should be >= 0, <= ~RUN_FOR_MS millis.
// Let's be generous with the slop factor, defined above, in case other things
// are happening on this CPU. The <= check may be invalid if the node process
// is making use of multiple CPUs, in which case, just remove it.
assert(diff.user >= 0);
-assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND);
+assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND);
assert(diff.system >= 0);
-assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND);
+assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND);