2

When I run/debug Ginkgo test from Intellij Idea (with Go plugin installed), it does not shut down gracefully if I press "Stop" button.

enter image description here

JustBeforeEach and AfterEach functions do not get executed and process stops immediately. When I run test from console it gracefully shuts down if I press Ctrl+C. How can I make Intellij Idea/Goland to send custom signal in order to stop running process?

My gotest options are: -ginkgo.v -ginkgo.progress -ginkgo.trace -ginkgo.focus=MyTest

2 Answers 2

4

GoLand sends a SIGINT then follows with a SIGKILL to terminate the process. You should make your application handle either of those signals before exiting.

Sign up to request clarification or add additional context in comments.

1 Comment

If so, why I don't see output after pressing Stop button here: stop := make(chan os.Signal, 1); signal.Notify(stop, syscall.SIGINT, syscall.SIGKILL); s := <-stop; fmt.Printf("\nGot signal:", s); I see output only if I press Ctrl+C
0

On a Linux/Unix OS, you can use the kill command. For example, if you want to send an interrupt signal, you would use kill -2 pid.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.