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

Go 1.17 breaks Windows tests #341

Closed
mbushkov opened this issue Sep 8, 2021 · 0 comments · Fixed by #342
Closed

Go 1.17 breaks Windows tests #341

mbushkov opened this issue Sep 8, 2021 · 0 comments · Fixed by #342
Assignees
Labels

Comments

@mbushkov
Copy link
Collaborator

mbushkov commented Sep 8, 2021

See: https://github.com/google/fleetspeak/runs/3537321341?check_suite_focus=true#step:7:138

The issue seems to be caused by the changes Kill() implementation on Windows in Go 1.17: golang/go@105c5b5#diff-6a84f2bc81cd5822adbd431f1f333fa14cbd37e5e88057dd11163ef5319dfd64

@mbushkov mbushkov self-assigned this Sep 8, 2021
@mbushkov mbushkov added the bug label Sep 8, 2021
mbushkov added a commit that referenced this issue Oct 11, 2021
This fixes #341

The issue was that building os.Process object as &os.Process{pid: 42}, even though it worked in previous Go versions, effectively breaks encapsulation and is not going to work with Go 1.17 at least on Windows. The correct solution is to use os.FindProcess.

Newly introduced function - KillProcessByPid() - should be used in cases where only a process pid is available. Whenever a fully-featured os.Process object is available, its Kill() method is preferred.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant