Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Broken Lifecycle Signal Tests #12220

@deckar01

Description

@deckar01

The tests in test/tap/lifecycle-signal.js are skipped on Windows and Travis, but are failing on Linux.

  • Ubuntu 15.04
  • node v5.10.0

lifecycle signal abort

This test fails because regardless of the signal used to kill the process in preinstall the child's exit code is 1 and exit signal is null. There seems to be an error handler stripping the signal and changing the code to 1. I tested that node -e wasn't eating the error, so it must be somewhere around the install action or the lifecycle.

test/tap/lifecycle-signal.js#L45

Originally added by @TooTallNate in d885f81

lifecycle propagate signal term to child

This test fails, because the test assumes killing a child process kills its subprocess, but that is incorrect.

I think you have the wrong idea about processes and process groups. On exit, child processes get reparented, they're not forcibly killed by io.js or the kernel.
nodejs/node#2098 (comment)

http://stackoverflow.com/questions/33325301/killing-a-bash-script-does-not-kill-child-processes

test/tap/lifecycle-signal.js#L67

Originally added by @daniel-pedersen in 5454347.


ubuntu@ubuntu:~/npm$ DEPLOY_VERSION=testing npm run tap -- "test/tap/lifecycle-signal.js" 

> [email protected] tap /home/ubuntu/npm
> tap --timeout 240 "test/tap/lifecycle-signal.js"

test/tap/lifecycle-signal.js .......................... 5/9 4m
  lifecycle signal abort
  not ok should be equal
    +++ found                                                          
    --- wanted                                                         
    -[null]                                                            
    +1                                                                 
    compare: ===
    at:
      line: 44
      column: 7
      file: test/tap/lifecycle-signal.js
      type: ChildProcess
    stack: |
      ChildProcess.<anonymous> (test/tap/lifecycle-signal.js:44:7)
      Pipe._onclose (net.js:477:12)

  lifecycle signal abort
  not ok should be equal
    +++ found                                                          
    --- wanted                                                         
    -"SIGSEGV"                                                         
    +[null]                                                            
    compare: ===
    at:
      line: 45
      column: 7
      file: test/tap/lifecycle-signal.js
      type: ChildProcess
    stack: |
      ChildProcess.<anonymous> (test/tap/lifecycle-signal.js:45:7)
      Pipe._onclose (net.js:477:12)

  lifecycle propagate signal term to child
  not ok expected to throw
    at:
      line: 68
      column: 7
      file: test/tap/lifecycle-signal.js
      type: ChildProcess
    stack: |
      ChildProcess.<anonymous> (test/tap/lifecycle-signal.js:68:7)

  not ok timeout!
    at:
      line: 3
      column: 11
      file: node_modules/tap/lib/root.js
    signal: SIGTERM
    handles:
      - type: Socket
        events:
          - end
          - finish
          - _socketEnd
          - close
      - type: Socket
        events:
          - end
          - finish
          - _socketEnd
          - close
          - data

total ................................................. 5/9


  5 passing (4m)
  4 failing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions