test: fix double close channel bug by removing wait in lightningNode.stop()
This commit fixes a panic bug caused by two calls to a process’ cmd.Wait() method. If two nodes incurred a fatal error as soon as they were created, then both the goroutine detected to recovering the stderr data and the defer statement would case a double channel close due to the simultaneous calls to Wait().
This commit is contained in:
1 file changed
-2
@@ -260,8 +260,6 @@ func (l *lightningNode) stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
defer l.cmd.Wait()
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
return l.cmd.Process.Signal(os.Kill)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user