Skip to content
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

Don't kill fkill when killing node #30

Merged
merged 5 commits into from Jun 15, 2019
Merged

Don't kill fkill when killing node #30

merged 5 commits into from Jun 15, 2019

Conversation

yaodingyd
Copy link
Contributor

fix #19

@sindresorhus
Copy link
Owner

Tests are failing.

@yaodingyd
Copy link
Contributor Author

Tests fixed.

index.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Do not kill fkill when killing node Don't kill fkill when killing node May 28, 2019
yaodingyd and others added 5 commits May 28, 2019 13:53
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
@sindresorhus sindresorhus merged commit e05fd83 into sindresorhus:master Jun 15, 2019
@sindresorhus
Copy link
Owner

@yaodingyd
Copy link
Contributor Author

@sindresorhus tests passed on my local node 12. will keep investigating.

@yaodingyd
Copy link
Contributor Author

@yaodingyd yaodingyd deleted the node branch June 16, 2019 02:22
@@ -73,6 +73,13 @@ test.serial('don\'t kill self', async t => {
Object.defineProperty(process, 'pid', {value: originalFkillPid});
});

test.serial('don\'t kill `fkill` when killing `node`', async t => {
const originalFkillPid = process.pid;
await fkill('node');
Copy link

Choose a reason for hiding this comment

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

Sorry if I may have missed the point of this PR but I don't understand how the this test is meant to work on Windows.

On Windows, if we try to kill node it won't find any process because the process name for the Node.js runtime it's node.exe, hence the test would pass because it won't kill fkill yes, but it also won't kill any other node processes as well, which kind of make it pointless to try killing by process name in the first place.

As an example, try running on a console node -e "while(true){}" and try running the test, which should kill all node processes, but it won't on Windows.

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Killing the node process without killing fkill
3 participants