-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: extend test scripts to cover OpenBSD #18543
Changes from 5 commits
13192a9
455dc60
42f51a5
de838fa
59edf9f
22eb27c
d0c6dfa
7aa9a7c
31d4c9a
ad7bf60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,15 +16,20 @@ const cmd = `"${process.execPath}" "${__filename}" child`; | |
|
||
// Test the case where a timeout is set, and it expires. | ||
cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => { | ||
let sigterm = 'SIGTERM'; | ||
assert.strictEqual(err.killed, true); | ||
assert.strictEqual(err.code, null); | ||
// TODO OpenBSD returns a null signal and 143 for code | ||
if (!common.isOpenBSD) | ||
assert.strictEqual(err.code, null); | ||
else | ||
sigterm = null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm not wrong this is now a global, the test should fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we assert that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably. Updated. |
||
// At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM to a | ||
// process that is still starting up kills it with SIGKILL instead of SIGTERM. | ||
// See: https://github.com/libuv/libuv/issues/1226 | ||
if (common.isOSX) | ||
assert.ok(err.signal === 'SIGTERM' || err.signal === 'SIGKILL'); | ||
else | ||
assert.strictEqual(err.signal, 'SIGTERM'); | ||
assert.strictEqual(err.signal, sigterm); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops - defined now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed the comment as well. |
||
assert.strictEqual(err.cmd, cmd); | ||
assert.strictEqual(stdout.trim(), ''); | ||
assert.strictEqual(stderr.trim(), ''); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,17 @@ const spawnSync = require('child_process').spawnSync; | |
const signals = process.binding('constants').os.signals; | ||
|
||
let invalidArgTypeError; | ||
let errCode = 56; | ||
if (common.isOpenBSD) | ||
errCode = 46; | ||
|
||
if (common.isWindows) { | ||
invalidArgTypeError = | ||
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 36); | ||
} else { | ||
invalidArgTypeError = | ||
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 56); | ||
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, | ||
errCode); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is not an But more importantly: I am very confused that it will not be triggered the same amount of times as on other systems. Windows skips a couple ones, that is the reason why it has a different call number. But OpenBSD should be called in all cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yeah my bad. I will revert this one and just leave it erroring for future investigation. There are some other strange things happening that might be related: in |
||
} | ||
|
||
const invalidRangeError = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before something uses process.execPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks for elaborating.