Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

tests all fail #7

Closed
sam-github opened this issue Oct 27, 2016 · 12 comments · Fixed by #11
Closed

tests all fail #7

sam-github opened this issue Oct 27, 2016 · 12 comments · Fixed by #11

Comments

@sam-github
Copy link
Contributor

core/nodereport (master *% u=) % npm test

> nodereport@0.1.0 test /home/sam/w/core/nodereport
> node test/autorun.js

autorun.js: running child process #1 to produce NodeReport on API call
autorun.js: running child process #2 to produce NodeReport on exception
autorun.js: running child process #3 to produce NodeReport on fatal error
autorun.js: running child process #4 to produce NodeReport on SIGUSR2
autorun.js: test results: 
        test 1 :  fail
        test 2 :  fail
        test 3 :  fail
        test 4 :  fail

assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at ChildProcess.<anonymous> (/home/sam/w/core/nodereport/test/autorun.js:27:10)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
npm ERR! Test failed.  See above for more details.

@sam-github
Copy link
Contributor Author

On node 6.9.1, nodereport commit 7cd3f76, ubuntu linux x64, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

@rnchamberlain
Copy link
Contributor

Can you try running the tests using: node node_modules/nodereport/test/autorun.js --save_log. That should save a nodereport_test.log file in the current directory with more info on the failures. Thanks.

@sam-github
Copy link
Contributor Author

sam-github commented Oct 28, 2016

Above is your problem, the tests assumed that nodereport was git cloned into a node_modules folder, so that it is requireable by name. #11 fixes that.

The tests don't instantly fail now (EDIT: "now" meaning after #11), but they don't complete, they print this to screen (EDIT: and then hang):

% node test/autorun.js --save_log
autorun.js: running child process #1 to produce NodeReport on API call
autorun.js: running child process #2 to produce NodeReport on exception
autorun.js: running child process #3 to produce NodeReport on fatal error
autorun.js: running child process #4 to produce NodeReport on SIGUSR2
autorun.js: located NodeReport:  NodeReport.20161028.084405.30239.001.txt
(node:30233) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
autorun.js: located NodeReport:  NodeReport.20161028.084405.30245.001.txt
(node:30233) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
autorun.js: located NodeReport:  NodeReport.20161028.084406.30252.001.txt
(node:30233) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

With a test log of https://gist.github.com/d4cef9d4f5691c44eb06ad97c000a380

Btw, its probably worth getting this building and running in CI, either the nodefoundation's if possible, or Travis.

@rnchamberlain
Copy link
Contributor

@sam-github prototype fix for the hang you are seeing in the tests:
npm install rnchamberlain/nodereport#avoid-jsstacktrace-in-gc

@sam-github
Copy link
Contributor Author

It's easier for me to git clone things you PR (you can PR before something is known to work, its OK). I'll go find add you as a git source and fetch your code.

@sam-github
Copy link
Contributor Author

core/nodereport (master u=) % git co -t remotes/rnchamberlain/avoid-jsstacktrace-in-gc
Branch avoid-jsstacktrace-in-gc set up to track remote branch avoid-jsstacktrace-in-gc from rnchamberlain.
Switched to a new branch 'avoid-jsstacktrace-in-gc'
core/nodereport (avoid-jsstacktrace-in-gc u=) % npm i

> nodereport@1.0.4 install /Users/sam/w/core/nodereport
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/nodereport/src/node_report.o
  CXX(target) Release/obj.target/nodereport/src/module.o
  SOLINK_MODULE(target) Release/nodereport.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
  COPY /Users/sam/w/core/nodereport/nodereport.node
  TOUCH Release/obj.target/install.stamp
nodereport@1.0.4 /Users/sam/w/core/nodereport
└── nan@2.4.0 

core/nodereport (avoid-jsstacktrace-in-gc u=) % npm test

> nodereport@1.0.4 test /Users/sam/w/core/nodereport
> node test/autorun.js

autorun.js: running child process #1 to produce NodeReport on API call
autorun.js: running child process #2 to produce NodeReport on exception
autorun.js: running child process #3 to produce NodeReport on fatal error
autorun.js: running child process #4 to produce NodeReport on SIGUSR2
autorun.js: test results: 
        test 1 :  fail
        test 2 :  fail
        test 3 :  fail
        test 4 :  fail

assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at ChildProcess.<anonymous> (/Users/sam/w/core/nodereport/test/autorun.js:27:10)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
npm ERR! Test failed.  See above for more details.

that's OS X, the original test was on Linux, I'll try Linux when I get home

@rnchamberlain
Copy link
Contributor

I merged #11 and doing so closed this issue. I'm assuming we need to keep this open as the tests are still failing, re-opening.

@rnchamberlain rnchamberlain reopened this Nov 1, 2016
@sam-github
Copy link
Contributor Author

sam-github commented Nov 1, 2016

core/nodereport (master u=) % node test/autorun.js --save_log                          
autorun.js: running child process #1 to produce NodeReport on API call
autorun.js: running child process #2 to produce NodeReport on exception
autorun.js: running child process #3 to produce NodeReport on fatal error
autorun.js: running child process #4 to produce NodeReport on SIGUSR2
autorun.js: located NodeReport:  NodeReport.20161101.085114.9593.001.txt
autorun.js: located NodeReport:  NodeReport.20161101.085114.9599.001.txt
autorun.js: located NodeReport:  NodeReport.20161101.085114.9600.001.txt
autorun.js: located NodeReport:  NodeReport.20161101.085115.9606.001.txt
autorun.js: test results: 
        test 1 :  pass
        test 2 :  pass
        test 3 :  fail
        test 4 :  pass
core/nodereport (master u=) % gist nodereport_test.log
https://gist.github.com/5c44b079d269515ba7a85b69830fe38a
core/nodereport (master u=) % node -v
v6.9.1

^--- linux run

On node 7, the tests never complete. My suspicion would be the use of readline, its not really for reading lines, its for complex I/O, like the node REPL. https://www.npmjs.com/package/byline might clear this away.

Can you not reproduce what I see, @rnchamberlain ? I assume the tests pass for you, but on what platforms?

@rnchamberlain
Copy link
Contributor

rnchamberlain commented Nov 3, 2016

@sam-github I reproduced the test suite hang on Linux x86, node 7. It gets stuck on test 3. #16 fixes it for me, the test suite completes now, all tests pass.

The autorun.js was supposed to cope with a hang in one of the individual tests, but I expect the restructure that @richardlau is doing will improve that aspect.

I'll look at the node 7 deprecation warnings,

@rnchamberlain
Copy link
Contributor

The node v7 deprecation warnings were from fs.unlink() in autorun.js. They are fixed in #15 (the NodeReport files produced by the tests are no longer deleted).

@rnchamberlain
Copy link
Contributor

@sam-github fyi the re-write of the tests using tap has landed now, could you re-test when convenient, thanks.

@sam-github
Copy link
Contributor Author

core/nodereport (master u=) % npm test

> nodereport@1.0.5 test /home/sam/w/core/nodereport
> tap test/test*.js

test/test-api.js ...................................... 7/7
test/test-exception.js ................................ 8/8
test/test-fatal-error.js .............................. 7/7
test/test-signal.js ................................... 8/8
total ............................................... 30/30

  30 passing (2s)

  ok
core/nodereport (master u=) % uname -a
Linux samtu 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
core/nodereport (master u=) % cat /etc/issue
Ubuntu 16.04.1 LTS \n \l

core/nodereport (master u=) % node -v
v6.9.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants