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

test: fix test-debug-port-numbers on OS X by santigimeno · Pull Request #7046 · nodejs/node · GitHub

/ node Public

test: fix test-debug-port-numbers on OS X - #7046

Merged
santigimeno merged 1 commit into
nodejs:masterfrom
santigimeno:debug_port
May 30, 2016
Merged

test: fix test-debug-port-numbers on OS X#7046
santigimeno merged 1 commit into
nodejs:masterfrom
santigimeno:debug_port

Conversation

santigimeno commented May 29, 2016
edited
Loading

Copy link
Copy Markdown
Member
Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

According to kill(2), kill returns EPERM error if when signalling a
process group any of the members could not be signaled.

Refs: #7037

nodejs-github-bot added the test Issues and PRs related to the tests. label May 29, 2016

Copy link
Copy Markdown
Member Author

This test was failing in OS X https://ci.nodejs.org/job/node-test-commit-osx/3581/nodes=osx1010/:

not ok 191 parallel/test-debug-port-numbers
# 
# assert.js:90
#   throw new assert.AssertionError({
#   ^
# AssertionError: 'EPERM' === 'ESRCH'
#     at kill (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/parallel/test-debug-port-numbers.js:47:12)
#     at update (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/parallel/test-debug-port-numbers.js:37:7)
#     at Socket.<anonymous> (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/parallel/test-debug-port-numbers.js:21:65)
#     at emitOne (events.js:101:20)
#     at Socket.emit (events.js:188:7)
#     at readableAddChunk (_stream_readable.js:172:18)
#     at Socket.Readable.push (_stream_readable.js:130:10)
#     at Pipe.onread (net.js:542:20)
# debug> debug> debug> debug> �< Debugger listening on port 12347
# debug> �connecting to 127.0.0.1:12347 ... ok
# debug> �< Debugger listening on port 12348
# debug> �connecting to 127.0.0.1:12348 ...�< Debugger listening on port 12346
# debug> �connecting to 127.0.0.1:12346 ...�< Debugger listening on port 12349
# debug> �connecting to 127.0.0.1:12349 ... ok
# debug>  ok
# debug>  ok
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# �  2 
# �  3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# �  2 
# �  3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# �  2 
# �  3 const common = require('../common');
# �break in test/parallel/test-debug-port-numbers.js:1

Copy link
Copy Markdown
Member Author

Stress test without this change fails: https://ci.nodejs.org/job/node-stress-single-test/749.
Stress test with this change passes: https://ci.nodejs.org/job/node-stress-single-test/750.

Copy link
Copy Markdown
Member

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

I think the logic should be ESRCH || EPERM iff OS X, and you might as well drop the 'iff OS X' part in that case because the BSDs probably exhibit the same behavior.

I checked the xnu and libc sources and the error code seems to depend on whether POSIX compatibility mode is enabled in the libc wrapper: it returns EPERM if it is, ESRCH otherwise. That would explain why I don't see EPERM with 10.8.

cjihrig commented May 29, 2016

Copy link
Copy Markdown
Contributor

LGTM. I think @bnoordhuis suggestion makes sense. One question though:

According to kill(2), kill returns EPERM error if when signalling a process group any of the members could not be signaled.

Does that mean that processes may be left behind?

Copy link
Copy Markdown
Member

@cjihrig My reading of the xnu sources is that EPERM or ESRCH are only returned when the process group is gone (i.e., empty.)

Copy link
Copy Markdown
Member Author

@bnoordhuis, from the FreeBSD 10.3 man: [EPERM] The sending process does not have permission to send sig to the receiving process. So I'm not sure if it applies to FreeBSD. I can add it anyway.

Copy link
Copy Markdown
Member

I think xnu inherits most of its signal handling logic from FreeBSD but it's possible that the POSIX compatibility stuff is a later addition. I don't think allowing EPERM on other platforms will hurt, at any rate.

Copy link
Copy Markdown
Member Author

Yes, it makes sense. So just to be sure... ESRCH || EPERM on OS X and FreeBSD right?

Copy link
Copy Markdown
Member

I'd do it unconditionally, i.e., no platform-specific checks.

Copy link
Copy Markdown
Member Author

PR updated per your comments. Thanks!

Copy link
Copy Markdown
Member Author

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

I don't think this is right. 'EPERM' || 'ESRCH' will always evaluate to EPERM

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

Also, assert.ok() just asserts that e.code is truthy.

Copy link
Copy Markdown
Member Author

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

You're right. I was fixing that :(

Copy link
Copy Markdown
Member Author

Updated

cjihrig commented May 29, 2016

Copy link
Copy Markdown
Contributor

LGTM

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member

LGTM

mscdex added the macos Issues and PRs related to the macOS platform / OSX. label May 29, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: nodejs#7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-commit/3579/. All green except some unrelated failures in some ARM bots. Landing

santigimeno merged commit 6e148a3 into nodejs:master May 30, 2016
santigimeno deleted the debug_port branch May 30, 2016 08:21

Copy link
Copy Markdown
Member Author

Landed in 6e148a3. Thanks!

Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request May 30, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: nodejs#7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
rvagg pushed a commit that referenced this pull request Jun 2, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins mentioned this pull request Jul 12, 2016
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: #7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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

macos Issues and PRs related to the macOS platform / OSX. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL