test: avoid double chan close in integration testing framework
This commit is contained in:
1 file changed
+8
-8
+8
-8
@@ -271,19 +271,19 @@ func (l *lightningNode) Stop() error {
|
|||||||
// - start of the node wasn't initiated
|
// - start of the node wasn't initiated
|
||||||
// - process wasn't spawned
|
// - process wasn't spawned
|
||||||
// - process already finished
|
// - process already finished
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
case <-l.quit:
|
||||||
|
return nil
|
||||||
case <-l.processExit:
|
case <-l.processExit:
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
close(l.quit)
|
|
||||||
l.wg.Wait()
|
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
return l.cmd.Process.Signal(os.Kill)
|
|
||||||
}
|
|
||||||
return l.cmd.Process.Signal(os.Interrupt)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(l.quit)
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return l.cmd.Process.Signal(os.Kill)
|
||||||
|
}
|
||||||
|
return l.cmd.Process.Signal(os.Interrupt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restart attempts to restart a lightning node by shutting it down cleanly,
|
// Restart attempts to restart a lightning node by shutting it down cleanly,
|
||||||
|
|||||||
Reference in new issue
Block a user