Skip to content

failed test: parallel/test-child-process-stdout-flush-exit #944

Closed

Description

@jbergstroem

I'm seeing a rare test fail (been able to reproduce twice over ~100 test runs) on a mac os x 10.10 machine. Tested with io.js 8a1e22a:

Path: parallel/test-child-process-stdout-flush-exit
assert.js:87
  throw new assert.AssertionError({
        ^
AssertionError: false == true
    at ChildProcess.<anonymous> (/Users/jbergstroem/io.js/test/parallel/test-child-process-stdout-flush-exit.js:43:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:169:7)
    at maybeClose (child_process.js:984:16)
    at Socket.<anonymous> (child_process.js:1153:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:166:7)
    at Pipe.close (net.js:464:12)
Command: out/Release/iojs /Users/jbergstroem/io.js/test/parallel/test-child-process-stdout-flush-exit.js

Activity

  1. added
    testIssues and PRs related to Node.js core tests and test infrastructure.
    on Feb 25, 2015
  2. jbergstroem commented on Mar 3, 2015

    @jbergstroem
    MemberAuthor

    Can't reproduce this any longer. Closing for now.

  3. Fishrock123 commented on Mar 4, 2015

    @Fishrock123
    Contributor

    There's something flaky going on here:

    Jeremiahs-MacBook-Pro:io.js Jeremiah$ make test
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -C out BUILDTYPE=Release V=1
    make[1]: Nothing to be done for `all'.
    ln -fs out/Release/iojs iojs
    /usr/bin/python tools/test.py --mode=release message parallel sequential -J
    === release test-child-process-stdout-flush-exit ===                      
    Path: parallel/test-child-process-stdout-flush-exit
    assert.js:87
      throw new assert.AssertionError({
            ^
    AssertionError: false == true
        at ChildProcess.<anonymous> (/Users/Jeremiah/Documents/io.js/test/parallel/test-child-process-stdout-flush-exit.js:43:5)
        at emitTwo (events.js:87:13)
        at ChildProcess.emit (events.js:169:7)
        at maybeClose (child_process.js:984:16)
        at Socket.<anonymous> (child_process.js:1153:11)
        at emitOne (events.js:77:13)
        at Socket.emit (events.js:166:7)
        at Pipe.close (net.js:464:12)
    Command: out/Release/iojs /Users/Jeremiah/Documents/io.js/test/parallel/test-child-process-stdout-flush-exit.js
    [00:57|% 100|+ 818|-   1]: Done                                                
    make: *** [test] Error 1
    

    OS X 10.10.2, io.js at 78581c8, happened only once so far.

  4. piscisaureus commented on Mar 4, 2015

    @piscisaureus
    Contributor

    @bnoordhuis Could this have something to do with stdout being asynchronous?

  5. tellnes commented on Mar 4, 2015

    @tellnes
    Contributor

    I've also seen this on os x 10.9.5.

  6. bnoordhuis commented on Mar 5, 2015

    @bnoordhuis
    Member

    @piscisaureus That seems to be the issue, yes. The test failure is 100% reproducible when you add a delay in the parent process:

    diff --git a/test/parallel/test-child-process-stdout-flush-exit.js b/test/parallel/test-child-process-stdout-flush-exit.js
    index eba8927..5fbb1e9 100644
    --- a/test/parallel/test-child-process-stdout-flush-exit.js
    +++ b/test/parallel/test-child-process-stdout-flush-exit.js
    @@ -17,6 +17,8 @@ if (process.argv[2] === 'child') {
       // spawn self as child
       var child = spawn(process.argv[0], [process.argv[1], 'child']);
    
    +  for (var t = Date.now(); t + 1e3 > Date.now(););
    +
       var gotHello = false;
       var gotBye = false;
    

    It doesn't seem to be an issue of libuv buffering data and not getting a chance to flush it because even when all writes hit the kernel, the test still fails. I speculate that data ends up in the kernel pipe buffer and is subsequently lost when the child process exits.

  7. Fishrock123 commented on Mar 22, 2015

    @Fishrock123
    Contributor

    Also cropped up on the latest (otherwise green) windows build: https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/359/nodes=iojs-win2012r2/console

  8. rvagg commented on Mar 22, 2015

    @rvagg
    Member

    been a semi-regular offender on the Windows CI machines of late actually

  9. abrady0 commented on Apr 23, 2015

    @abrady0

    I'm seeing this 100% of the time when a child process outputs a large amount of text (>8k) and calls subprocess.exit().

    here is a gist that repros: https://gist.github.com/abrady0/f69de07b79d1b50b0ca0

    if you comment line 43 out it will succeed.

  10. Fishrock123 commented on Jun 2, 2015

    @Fishrock123
    Contributor

    Should be fixed in 311c3e4

  11. bnoordhuis commented on Jun 2, 2015

    @bnoordhuis
    Member

    Make that b926718.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues and PRs related to Node.js core tests and test infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions