strongloop / strong-agent

Profile, control, and monitor Node.js processes and clusters
http://strongloop.com/node-js/devops-tools/
Other
62 stars 9 forks source link

"npm test" failing #7

Closed ghatwala closed 9 years ago

ghatwala commented 9 years ago

Hi,

I was able to build this repo on my set up below : ppc64le _ rhel 7.1 using "npm install" But when i tried to test case using "npm test" command , i got below errors: There are two sub-tests which are failing mailing due to watchdog/profiling related errors. Please see snippet below.

$npm test
# test-event-loop-watchdog.js
# strong-agent dashboard is at https://strongops.strongloop.com
# strong-agent v2.0.1 profiling app 'some key' pid '28564'
# strong-agent[28564] started profiling agent
/home/test/strongloop_pck/strong-agent/lib/profilers/cpu.js:26
    throw Error(errmsg);
    ^
Error: watchdog profiling not supported on this platform
    at Error (native)
    at Object.exports.start (/home/test/strongloop_pck/strong-agent/lib/profilers/cpu.js:26:11)
    at Object.<anonymous> (/home/test/strongloop_pck/strong-agent/test/test-event-loop-watchdog.js:54:10)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
not ok 116 test/test-event-loop-watchdog.js
  ---
    exit:    1
    stderr:  |
      /home/test/strongloop_pck/strong-agent/lib/profilers/cpu.js:26
          throw Error(errmsg);
          ^
      Error: watchdog profiling not supported on this platform
          at Error (native)
          at Object.exports.start (/home/test/strongloop_pck/strong-agent/lib/profilers/cpu.js:26:11)
          at Object.<anonymous> (/home/test/strongloop_pck/strong-agent/test/test-event-loop-watchdog.js:54:10)
          at Module._compile (module.js:434:26)
          at Object.Module._extensions..js (module.js:452:10)
          at Module.load (module.js:355:32)
          at Function.Module._load (module.js:310:12)
          at Function.Module.runMain (module.js:475:10)
          at startup (node.js:117:18)
          at node.js:951:3
    command: "/usr/local/bin/node --expose-gc test-event-loop-watchdog.js"
  ...

# test-watchdog-activation-count.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at Object.<anonymous> (/home/test/strongloop_pck/strong-agent/test/test-watchdog-activation-count.js:25:1)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
not ok 189 test/test-watchdog-activation-count.js
  ---
    exit:    1
    stderr:  |
      assert.js:89
        throw new assert.AssertionError({
        ^
      AssertionError: false == true
          at Object.<anonymous> (/home/test/strongloop_pck/strong-agent/test/test-watchdog-activation-count.js:25:1)
          at Module._compile (module.js:434:26)
          at Object.Module._extensions..js (module.js:452:10)
          at Module.load (module.js:355:32)
          at Function.Module._load (module.js:310:12)
          at Function.Module.runMain (module.js:475:10)
          at startup (node.js:117:18)
          at node.js:951:3
    command: "/usr/local/bin/node --expose-gc test-watchdog-activation-count.js"
  ...
1..189
# tests 189
# pass  180
# fail  2
# skip  7
npm ERR! Test failed.  See above for more details.

Even when i tried to install watching it gives me following.

[test@pts00449-vm19 strong-agent]$ npm install watchdog
npm WARN package.json strong-agent@2.0.1 license should be a valid SPDX license expression
npm WARN engine watchdog@0.0.0: wanted: {"node":">= 0.4.x < 0.7.0"} (current: {"node":"4.1.1","npm":"2.14.4"})
watchdog@0.0.0 node_modules/watchdog
âââ async@0.1.22
âââ distribute@0.1.4 (debug@0.1.0, http-proxy@0.8.0)

Any pointers to resolve the above failures will be helpful. Is watchdog profiling not supported as of now ? Please comment.

bnoordhuis commented 9 years ago

Watchdog profiling is not currently supported on ppc64.

npm install watchdog

That's a different module and not maintained by us. strong-agent's watchdog mode is integrated into the agent, no other modules required.

ghatwala commented 9 years ago

hi @bnoordhuis , Thanks for your quick reply !!! As the default watchdog mode present in strong-agent is not supported on ppc64 , could you please let me know how to exclude "watchdog profiling" from test cases build step ? I want to verify if other test cases are passing ?

bnoordhuis commented 9 years ago

It needs some minor adjustments to the test suite. I'll make sure they're in the next release but for now you can make do by applying them locally.

From d3e066a2e547e64483d5b5efa613cbe1ac24c623 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Mon, 2 Nov 2015 13:54:48 +0100
Subject: [PATCH] Restrict watchdog tests to ia32/x64 linux.

Tighten the platform/architecture checks so that people can run the
test suite without failures on PPC64.

Fixes: https://github.com/strongloop/strong-agent/issues/7
---
 test/common.js                         | 9 +++++++++
 test/test-event-loop-watchdog.js       | 9 +++------
 test/test-no-watchdog.js               | 3 ++-
 test/test-watchdog-activation-count.js | 9 +++------
 4 files changed, 17 insertions(+), 13 deletions(-)
 create mode 100644 test/common.js

diff --git a/test/common.js b/test/common.js
new file mode 100644
index 0000000..4742dee
--- /dev/null
+++ b/test/common.js
@@ -0,0 +1,9 @@
+'use strict';
+
+module.exports = { canWatchdog: canWatchdog };
+
+function canWatchdog() {
+  return process.platform === 'linux' &&
+         (process.arch === 'ia32' || process.arch === 'x64') &&
+         (process.versions.v8 < '3.15' || process.versions.v8 >= '3.29');
+}
diff --git a/test/test-event-loop-watchdog.js b/test/test-event-loop-watchdog.js
index acbbe74..a548c77 100644
--- a/test/test-event-loop-watchdog.js
+++ b/test/test-event-loop-watchdog.js
@@ -1,12 +1,9 @@
 'use strict';

-if (process.platform !== 'linux') {
-  console.log('1..0 # SKIP watchdog is Linux-only for now');
-  return;
-}
+var common = require('./common');

-if (process.versions.v8 >= '3.15' && process.versions.v8 < '3.29') {
-  console.log('1..0 # SKIP watchdog is incompatible with this node version');
+if (!common.canWatchdog()) {
+  console.log('1..0 # SKIP no watchdog for this arch/platform/runtime');
   return;
 }

diff --git a/test/test-no-watchdog.js b/test/test-no-watchdog.js
index d4b4924..31e0f2e 100644
--- a/test/test-no-watchdog.js
+++ b/test/test-no-watchdog.js
@@ -3,9 +3,10 @@
 var addon = require('../lib/addon');
 var agent = require('../');
 var assert = require('assert');
+var common = require('./common');
 var profiler = require('../lib/profilers/cpu');

-if (process.platform === 'linux') {
+if (common.canWatchdog()) {
   addon.startCpuProfiling = function(timeout) { if (timeout) return 'BAM'; };
 }

diff --git a/test/test-watchdog-activation-count.js b/test/test-watchdog-activation-count.js
index d9fa5bb..ab489e2 100644
--- a/test/test-watchdog-activation-count.js
+++ b/test/test-watchdog-activation-count.js
@@ -1,12 +1,9 @@
 'use strict';

-if (process.platform !== 'linux') {
-  console.log('1..0 # SKIP watchdog is Linux-only for now');
-  return;
-}
+var common = require('./common');

-if (process.versions.v8 >= '3.15' && process.versions.v8 < '3.29') {
-  console.log('1..0 # SKIP watchdog is incompatible with this node version');
+if (!common.canWatchdog()) {
+  console.log('1..0 # SKIP no watchdog for this arch/platform/runtime');
   return;
 }
ghatwala commented 9 years ago

Thanks @bnoordhuis : post application of the above patch locally , all test cases are passing . Requesting you to commit the above changes to the top of release.