test: signal the process for exit before shutting down local goroutines
This commit is tied to the prior commit and it patches up a lingering race condition and deadlock that can arise due to now properly waiting for all goroutine to exit before concluding the shutdown process.
This commit is contained in:
parent
bfdb2bebe2
commit
e947162d97
@ -1509,6 +1509,7 @@ func testRevokedCloseRetribution(net *networkHarness, t *harnessTest) {
|
||||
|
||||
// Next query for Bob's channel state, as we sent 3 payments of 10k
|
||||
// satoshis each, Bob should now see his balance as being 30k satoshis.
|
||||
time.Sleep(time.Millisecond * 200)
|
||||
bobChan, err := getBobChanInfo()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get bob's channel info: %v", err)
|
||||
|
@ -279,12 +279,17 @@ func (l *lightningNode) Stop() error {
|
||||
default:
|
||||
}
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
if err := l.cmd.Process.Signal(os.Kill); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := l.cmd.Process.Signal(os.Interrupt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
close(l.quit)
|
||||
l.wg.Wait()
|
||||
if runtime.GOOS == "windows" {
|
||||
return l.cmd.Process.Signal(os.Kill)
|
||||
}
|
||||
return l.cmd.Process.Signal(os.Interrupt)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Restart attempts to restart a lightning node by shutting it down cleanly,
|
||||
|
Loading…
Reference in New Issue
Block a user