summaryrefslogtreecommitdiff
path: root/integrationtests/harness.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/harness.go')
-rw-r--r--integrationtests/harness.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/integrationtests/harness.go b/integrationtests/harness.go
index a130c85..a8a73d0 100644
--- a/integrationtests/harness.go
+++ b/integrationtests/harness.go
@@ -146,8 +146,10 @@ func waitBoth(workloadCmd, iorCmd *exec.Cmd, duration int, grace time.Duration)
workloadDone := make(chan error, 1)
iorDone := make(chan error, 1)
- go func() { workloadDone <- workloadCmd.Wait() }()
- go func() { iorDone <- iorCmd.Wait() }()
+ // Pass channels as parameters so subsequent nil assignments in this
+ // function do not affect the goroutines' send targets.
+ go func(ch chan error) { ch <- workloadCmd.Wait() }(workloadDone)
+ go func(ch chan error) { ch <- iorCmd.Wait() }(iorDone)
timeout := time.After(time.Duration(duration)*time.Second + grace)