From 25d56eda6f6c6748d9243a5747b7e6cf70599e84 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 13 Apr 2018 09:09:26 +0200 Subject: [PATCH] lntest: timeout if process not exited in 1 minute --- lntest/node.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lntest/node.go b/lntest/node.go index 1122e088..502ae52f 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -429,7 +429,12 @@ func (hn *HarnessNode) stop() error { } // Wait for lnd process and other goroutines to exit. - <-hn.processExit + select { + case <-hn.processExit: + case <-time.After(60 * time.Second): + return fmt.Errorf("process did not exit") + } + close(hn.quit) hn.wg.Wait()