FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: fix test-process-kill-null.js for Windows by starkwang · Pull Request #14099 · nodejs/node · GitHub

/ node Public

test: fix test-process-kill-null.js for Windows - #14099

Closed
starkwang wants to merge 1 commit into
nodejs:masterfrom
starkwang:fix-test-process-kill-null
Closed

test: fix test-process-kill-null.js for Windows#14099
starkwang wants to merge 1 commit into
nodejs:masterfrom
starkwang:fix-test-process-kill-null

Conversation

Copy link
Copy Markdown
Contributor

The test-process-kill-null.js failed in Windows because cat command is invalid for Windows cmd.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

nodejs-github-bot added the test Issues and PRs related to the tests. label Jul 6, 2017

Copy link
Copy Markdown
Member

The test-process-kill-null.js failed in Windows because cat command is invalid for Windows cmd.

It's included in Git bash. From BUILDING.md:

  • Basic Unix tools required for some tests, Git for Windows includes Git Bash and tools which can be included in the global PATH.

starkwang closed this Jul 6, 2017
refack reopened this Jul 7, 2017

refack commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

I want this.
The MSYS cat is a ported utility and it's not as robust on windows as it is on *nix.
If we could remove the git-for-windows dependancy, all the better.

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The recommended test is common.isWindows (assign const common on L23)

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

add common.mustCall

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

not needed

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

add common.mustCall

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

not needed

Comment thread test/parallel/test-process-kill-null.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not needed.

refack added process Issues and PRs related to the process subsystem. windows Issues and PRs related to the Windows platform. labels Jul 7, 2017
starkwang force-pushed the fix-test-process-kill-null branch from 7b96888 to 310a19c Compare July 7, 2017 02:25

Copy link
Copy Markdown
Contributor Author

Pushed commit to address comments.

refack commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

refack pushed a commit to refack/node that referenced this pull request Jul 8, 2017
PR-URL: nodejs#14099
Reviewed-By: Refael Ackermann <refack@gmail.com>

refack commented Jul 8, 2017

Copy link
Copy Markdown
Contributor

landed in 44483b6

refack closed this Jul 8, 2017

refack commented Jul 8, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

refack commented Jul 8, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

@starkwang might will need a followup PR to fix this flakiness:

not ok 235 parallel/test-process-kill-null
  ---
  duration_ms: 0.255
  severity: fail
  stack: |-
    internal/process.js:190
          throw errnoException(err, 'kill');
          ^
    
    Error: kill ESRCH
        at exports._errnoException (util.js:1023:11)
        at process.kill (internal/process.js:190:13)
        at Socket.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vs2015\label\win2012r2\test\parallel\test-process-kill-null.js:38:11)
        at Socket.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vs2015\label\win2012r2\test\common\index.js:518:15)
        at emitOne (events.js:115:13)
        at Socket.emit (events.js:210:7)
        at addChunk (_stream_readable.js:252:12)
        at readableAddChunk (_stream_readable.js:239:11)
        at Socket.Readable.push (_stream_readable.js:197:10)
        at Pipe.onread (net.js:589:20)
  ...

https://ci.nodejs.org/job/node-test-binary-windows/9711/RUN_SUBSET=3,VS_VERSION=vs2015,label=win2012r2/

Running another windows CI: https://ci.nodejs.org/job/node-test-commit-windows-fanned/10278/

refack mentioned this pull request Jul 9, 2017
3 tasks
refack added a commit to refack/node that referenced this pull request Jul 9, 2017
This reverts commit 44483b6.

PR-URL: nodejs#14142
Fixes: nodejs#14141
Refs: nodejs#14099
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
refack reopened this Jul 9, 2017

refack commented Jul 9, 2017

Copy link
Copy Markdown
Contributor

@nodejs/platform-windows could the kill ESRCH ("No such process") actually be a bug?
micro context:

child.stdout.on('data', common.mustCall(function() {
  process.kill(child.pid, 'SIGKILL');
}

Copy link
Copy Markdown
Member

It probably means the child has exited before the kill was attempted.

https://nodejs.org/dist/latest-v8.x/docs/api/child_process.html#child_process_child_kill_signal

The ChildProcess object may emit an 'error' event if the signal cannot be delivered.

refack commented Jul 9, 2017

Copy link
Copy Markdown
Contributor

It probably means the child has exited before the kill was attempted.

https://nodejs.org/dist/latest-v8.x/docs/api/child_process.html#child_process_child_kill_signal

The ChildProcess object may emit an 'error' event if the signal cannot be delivered.

It's more a case of https://nodejs.org/dist/latest-v8.x/docs/api/process.html#process_process_kill_pid_signal

This method will throw an error if the target pid does not exist.
...
Windows platforms will throw an error if the pid is used to kill a process group.

But presumably in this case we attempt to kill only if we get something from stdout.
I'll try to repro locally. I smell something fishy 👃

Copy link
Copy Markdown
Member

The child process can exit between Node.js reading stdout and calling the on 'data' callback.

gibfahn commented Jul 12, 2017

Copy link
Copy Markdown
Member

@refack can you open a new PR? Now this has been reverted I don't think we should keep using it, it's likely to confuse things like branch-diff (and collaborators!).

IDK if there's a standard way to do this, but don't land a PR twice seems like a reasonable rule.

gibfahn closed this Jul 12, 2017

refack commented Jul 12, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

@refack can you open a new PR? Now this has been reverted I don't think we should keep using it, it's likely to confuse things like branch-diff (and collaborators!).

IDK if there's a standard way to do this, but don't land a PR twice seems like a reasonable rule.

I consulted with @addaleax and @Trott and this seems like the "standard" way 🤷‍♂️

gibfahn commented Jul 12, 2017

Copy link
Copy Markdown
Member

I consulted with @addaleax and @Trott and this seems like the "standard" way 🤷‍♂️

Happy to be wrong if others disagree.

Trott commented Jul 12, 2017

Copy link
Copy Markdown
Member

I consulted with @addaleax and @Trott and this seems like the "standard" way 🤷‍♂️

I'm not 100% sure that re-landing from the same PR is the standard way. But if @addaleax says it's OK, that's good enough for me.

Copy link
Copy Markdown
Member

I wouldn’t know that there’s a standard way to handle this either. Opening a new PR is certainly easier for everyone and will make sure the new commit won’t get overlooked, but reverts are probably rare enough that handling them manually is feasible.

refack commented Jul 12, 2017

Copy link
Copy Markdown
Contributor

@starkwang Would you like to open a new PR for this?

Copy link
Copy Markdown
Contributor Author

Yes, I'd like to do it. I'm trying to reproduce the flakiness locally.

refack commented Jul 12, 2017

Copy link
Copy Markdown
Contributor

@starkwang you could try spawn('type con', { shell: true }) that will start cmd.exe with the right arguments to run type con which is sort of the equivalent to cat with no args

refack commented Jul 12, 2017

Copy link
Copy Markdown
Contributor

P.S. @starkwang if you want your full name in the logs you could follow https://help.github.com/articles/setting-your-username-in-git/

gibfahn commented Jul 13, 2017

Copy link
Copy Markdown
Member

So at the moment your Git author name and email address are set to:

starkwang <381152119@qq.com>

People usually choose to use their full names for commits. To set your name globally you can do:

git config --global user.name "Weijia Wang"
git config --global user.email "381152119@qq.com"

To change the author for a single commit you can do:

git commit --amend --author="Weijia Wang <381152119@qq.com>"
git push --force-with-lease

It's entirely optional.

Copy link
Copy Markdown
Contributor Author

@gibfahn Thanks for your suggestion! :D
I've changed the user information in Git.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

process Issues and PRs related to the process subsystem. test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL