Merge branch 'tinygrasshopper-docs-for-process-trackers' into gh-pages
diff --git a/index.md b/index.md index 30753b7..29dd6e6 100644 --- a/index.md +++ b/index.md
@@ -1582,6 +1582,38 @@ Ω(session.Wait().Out.Contents()).Should(ContainSubstring("finished successfully")) +### Signaling all processes +`gexec` provides methods to track and send signals to all processes that it starts. + + gexec.Kill() //sends SIGKILL to all processes + gexec.Terminate() //sends SIGTERM to all processes + gexec.Signal(int) //sends the passed in os.Signal signal to all the processes + gexec.Interrupt() //sends SIGINT to all processes + +If the any of the processes have already exited these signal calls are no-ops. + +`gexec` also provides methods to cleanup and wait for all the processes it started. + + gexec.KillAndWait() + gexec.TerminateAndWait() + +You can specify a custom timeout by: + + gexec.KillAndWait(5 * time.Second) + gexec.TerminateAndWait(2 * time.Second) + +The timeout is applied for each of the processes. + +It is considered good practice to ensure all of your processes have been killed before the end of the test suite. If you are using `ginkgo` you can use: + + AfterSuite(func(){ + gexec.KillAndWait() + }) + +Due to the global nature of these methods, keep in mind that signaling processes will affect all processes started by `gexec`, in any context. For example if these methods where used in an `AfterEach`, then processes started in `BeforeSuite` would also be signaled. + +--- + ## `gstruct`: Testing Complex Data Types `gstruct` simplifies testing large and nested structs and slices. It is used for building up complex matchers that apply different tests to each field or element. @@ -1707,5 +1739,3 @@ "Rootfs": m.Ignore(), "Logs": m.Ignore(), })) - ----