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:
Viktor Torstensson 2026-04-02 00:54:16 +02:00
parent 8cae3364fb
commit 5b6ac91513
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4

View file

@ -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