mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
itest: avoid blocking on failed litd exits
Close the process exit signal before forwarding litd startup errors from the wait goroutine. This lets the harness observe that the process has already exited even when no receiver is currently ready on the error channel. Use a non-blocking send for the captured process error so failed startup paths do not hang the goroutine while holding back log finalization or process exit handling. This will be needed for the upcoming commit which adds itest coverage of deprecated kvdb databases.
This commit is contained in:
parent
8cae3364fb
commit
5b6ac91513
1 changed files with 10 additions and 4 deletions
|
|
@ -792,15 +792,21 @@ func (hn *HarnessNode) Start(litdBinary string,
|
|||
defer hn.wg.Done()
|
||||
|
||||
err := hn.cmd.Wait()
|
||||
if err != nil {
|
||||
litdError <- fmt.Errorf("%v\n%v\n", err, errb.String())
|
||||
}
|
||||
|
||||
// Signal any onlookers that this process has exited.
|
||||
close(hn.processExit)
|
||||
|
||||
// Make sure log file is closed and renamed if necessary.
|
||||
finalizeLogfile()
|
||||
|
||||
if err != nil {
|
||||
select {
|
||||
case litdError <- fmt.Errorf(
|
||||
"%v\n%v\n", err, errb.String(),
|
||||
):
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// We may want to skip waiting for the node to come up (eg. the node
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue