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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run 'fail' test on Windows too #17

Merged
merged 5 commits into from
Apr 18, 2017

Conversation

alextes
Copy link
Contributor

@alextes alextes commented Mar 29, 2017

Moves the 'fail' test from non-windows only to running on all systems.

taskkill already does throw when not finding a process to kill. However, we were adding a filter not to kill ourselves. The filter for some reason feels that it doesn't have to kill anything to be successful 馃檨.

We currently filter on our pid twice. Maybe I'm missing something obvious, after all, I also missed the fact we're filtering out our pid twice. It looks to me like there is no reason.

  • Filter out our pid once, using JS, not taskkill filters.
  • Add a test to filter our pid (if possible).

fixes #16

@alextes alextes force-pushed the always-run-fail-test branch 2 times, most recently from e691843 to a96e910 Compare April 1, 2017 18:48
@sindresorhus sindresorhus changed the title Run 'fail' test on windows too Run 'fail' test on Windows too Apr 2, 2017
@sindresorhus
Copy link
Owner

Can you rebase from master so you'll get the test delay.

@alextes
Copy link
Contributor Author

alextes commented Apr 2, 2017

I will. Was waiting to see if you would 馃槈.

(I'll mind my capitalization 馃槄.)

@sindresorhus
Copy link
Owner

Maybe I'm missing something obvious, after all, I also missed the fact we're filtering out our pid twice. It looks to me like there is no reason.

I think it's an additional protection to not kill ourselves when killing by name. The JS filter only filters PIDs.

@alextes
Copy link
Contributor Author

alextes commented Apr 2, 2017

Alright, can I add process.title to the filter then?

@sindresorhus
Copy link
Owner

@alextes No, process title by default is just generic node. That means it would match all node processes, not just this one.

@sindresorhus
Copy link
Owner

Seems like the tests here are failing on Windows.

@alextes
Copy link
Contributor Author

alextes commented Apr 2, 2017

They pass locally on win10. I'm confused. Leave this one for now and let me do some digging.

@alextes
Copy link
Contributor Author

alextes commented Apr 2, 2017

I think it's an additional protection to not kill ourselves when killing by name. The JS filter only filters PIDs.

Ah. When killing 'node' we should kill all node processes, except our own, which can only be done by excluding our pid. We did this on Windows, but not for the rest. I had a quick look. Don't think this can be done for killall.

Since leaving the filter in would mean giving up on getting a 'not found' error, and leaving in inconsistent behavior, how about I open a new issue (last one I promise 馃槗), with the suggestion to kill PID's excluding our own in case of the input being 'node'?

@sindresorhus
Copy link
Owner

Sure

@alextes alextes force-pushed the always-run-fail-test branch 4 times, most recently from 45053fa to 648bbac Compare April 2, 2017 20:40
Adding a filter that correctly, doesn't match our process id, makes taskkill
exit with "INFO: No tasks running with the specified criteria." even if no
processes were killed. We'll find another way to prevent killing
ourselves if killing 'node'.
Mocks the global process.pid to make sure a failing test wouldn't
kill the test itself.
@alextes
Copy link
Contributor Author

alextes commented Apr 2, 2017

@sindresorhus this is ready to merge now.

Most times AppVeyor will not kill 'notepad.exe' without force. I do not understand it.
I'll open an issue, and when I have time a PR to deal with killing node by name.

@sindresorhus sindresorhus merged commit 324c1da into sindresorhus:master Apr 18, 2017
@sindresorhus
Copy link
Owner

Awesome :)

I'll open an issue, and when I have time a PR to deal with killing node by name.

猬嗭笍 Make sure to open that issue ;)

@alextes alextes deleted the always-run-fail-test branch April 18, 2017 07:58
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.

Why is the 'fail' test not executed on windows?
2 participants