tap tests are broken on Windows again #4316

Open
domenic opened this Issue Dec 14, 2013 · 3 comments

3 participants

@domenic
npm member

Not really sure how to fix these; do they actually pass on *-nix?

$ node test/tap/startstop.js
TAP version 13
# setup
# npm start
not ok 1 should be equal
  ---
    file:   events.js
    line:   120
    column: 20
    stack:
      - getCaller (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:418:17)
      - assert (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:21:16)
      - Function.equal (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:162:10)
      - Test._testAssert [as equal] (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-test.js:87:16)
      - Socket.<anonymous> (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\test\tap\startstop.js:39:9)
      - Socket.EventEmitter.emit (events.js:120:20)
      - _stream_readable.js:896:16
      - process._tickCallback (node.js:598:11)
    found:  > node -e 'console.log("start")'
    wanted: start
    diff:   |
      FOUND:  > node -e 'console.log(\"start\")'
      WANTED: start
              ^ (at position = 0)
  ...
# npm stop
not ok 2 should be equal
  ---
    file:   events.js
    line:   120
    column: 20
    stack:
      - getCaller (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:418:17)
      - assert (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:21:16)
      - Function.equal (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-assert.js:162:10)
      - Test._testAssert [as equal] (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-test.js:87:16)
      - Socket.<anonymous> (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\test\tap\startstop.js:39:9)
      - Socket.EventEmitter.emit (events.js:120:20)
      - _stream_readable.js:896:16
      - process._tickCallback (node.js:598:11)
    found:  > node -e 'console.log("stop")'
    wanted: stop
    diff:   |
      FOUND:  > node -e 'console.log(\"stop\")'
      WANTED: stop
              ^ (at position = 0)
  ...
# npm restart
ok 3 should be equal
# cleanup

1..3
# tests 3
# pass  1
# fail  2
$ node test/tap/version-no-tags.js
Reinitialized existing Git repository in c:/Users/Domenic/Dropbox/GitHub/isaacs/npm/test/tap/version-no-tags/.git/
v0.0.1
TAP version 13
# npm version <semver> without git tag
ok 1 (unnamed assert)
ok 2 git tag DOES exist
ok 3 git tag does not exist
# cleanup
not ok 4 Error: EBUSY, resource busy or locked 'c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\test\tap\version-no-tags'
  ---
    type:    Error
    message: EBUSY, resource busy or locked 'c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\test\tap\version-no-tags'
    code:    EBUSY
    errno:   -4082
    file:    fs.js
    line:    752
    column:  18
    stack:
      - Object.fs.unlinkSync (fs.js:752:18)
      - Function.rimrafSync (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\rimraf\rimraf.js:148:8)
      - Test.<anonymous> (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\test\tap\version-no-tags.js:56:10)
      - Test.EventEmitter.emit (events.js:120:20)
      - Test.emit (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-test.js:104:8)
      - GlobalHarness.Harness.process (c:\Users\Domenic\Dropbox\GitHub\isaacs\npm\node_modules\tap\lib\tap-harness.js:87:13)
      - process._tickCallback (node.js:598:11)
    thrown:  true
  ...

1..4
# tests 4
# pass  3
# fail  1
@robertkowalski
npm member

Yes, they pass on *nix.

I had the same issue with a PR from me that deals with git (#4108), one workaround is to change the working directory before you delete the files, if I remember right:

robertkowalski@fbd5189#diff-13db9911efbf178a93fe46158cccbe50R39

@domenic domenic added a commit that referenced this issue Dec 14, 2013
@domenic domenic Fix version-no-tags test on Windows.
Helps with #4316. Thanks @robertkowalski for the idea on how to fix.
32cc890
@domenic
npm member

OK cool, fixed that.

But I don't get the start/stop tests failing... on *nix, npm outputs the scripts being run too, right? E.g. https://travis-ci.org/domenic/path-is-inside/jobs/15457935#L130

@robertkowalski
npm member

Sorry for the late answer. Yes, they are outputted.

@iarna iarna added the bug label Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment