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

Avoid sending a signal or killing the session if the process is not alive #259

Merged
merged 1 commit into from
Jan 30, 2018

Conversation

nodo
Copy link
Collaborator

@nodo nodo commented Jan 25, 2018

Fix issue #258

@nodo nodo requested review from tinygrasshopper and removed request for tinygrasshopper January 25, 2018 20:40
@williammartin
Copy link
Collaborator

Looks sensible to me but I'm wondering if we can consolidate on using signal in Kill like:

func (s *Session) Kill() *Session {
	return s.Signal(syscall.SIGKILL)
}

Just seems we could get rid of an extra conditional at the cost of a slightly less lower abstraction, which I think on the whole is a win. WDYT?

@nodo
Copy link
Collaborator Author

nodo commented Jan 30, 2018

I think it makes sense @williammartin.

I can also see that using Signal in kill is consistent with Terminate and Interrupt (https://github.com/onsi/gomega/blob/master/gexec/session.go#L161-L181). Even though they don't have a correspondent method in process (which is the case for kill), the code would like nicer.

@williammartin
Copy link
Collaborator

LGTM thanks

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

Successfully merging this pull request may close these issues.

2 participants