Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-03-23 21:33:59 +0300
committerNick Thomas <nick@gitlab.com>2018-03-23 21:48:08 +0300
commitac41e27e698687a70c4eebb612d8bb3eafd66caf (patch)
tree6f937bd64abed0649ff8dd8ffee5f67777d9e77a /helpers_test.go
parent5d09250074dc6023e130cc55087eda27a6a18d8c (diff)
Fix intermittent "zombie" process creation
These processes weren't actually zombies at all, they were still running fine - just outliving their parents as they were never given an interrupt signal in the timeout case.
Diffstat (limited to 'helpers_test.go')
-rw-r--r--helpers_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/helpers_test.go b/helpers_test.go
index dd74fca1..e4fec847 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -210,18 +210,21 @@ func runPagesProcess(t *testing.T, wait bool, pagesPath string, listeners []List
close(waitCh)
}()
+ cleanup := func() {
+ cmd.Process.Signal(os.Interrupt)
+ <-waitCh
+ }
+
if wait {
for _, spec := range listeners {
if err := spec.WaitUntilRequestSucceeds(waitCh); err != nil {
+ cleanup()
t.Fatal(err)
}
}
}
- return func() {
- cmd.Process.Signal(os.Interrupt)
- <-waitCh
- }
+ return cleanup
}
func getPagesArgs(t *testing.T, listeners []ListenSpec, promPort string, extraArgs []string) (args, tempfiles []string) {