From ea2b706174af45b7f213e50112a8c6b5b848a8dc Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 17 Jul 2018 09:13:05 +0200 Subject: [PATCH] lntest/node: make sure finalizing file is over before stop --- lntest/node.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lntest/node.go b/lntest/node.go index 883a248d..a33e0e29 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -335,9 +335,11 @@ func (hn *HarnessNode) start(lndError chan<- error) error { // Launch a new goroutine which that bubbles up any potential fatal // process errors to the goroutine running the tests. hn.processExit = make(chan struct{}) + hn.wg.Add(1) go func() { - err := hn.cmd.Wait() + defer hn.wg.Done() + err := hn.cmd.Wait() if err != nil { lndError <- errors.Errorf("%v\n%v\n", err, errb.String()) }