lntest+itest: kill node and wait its process
Fix a flake found in `testRPCMiddlewareInterceptor` when running in macOS.
This commit is contained in:
3 files changed
+21
-9
No files matched your search
@@ -796,6 +796,18 @@ func (hn *HarnessNode) Kill() error {
|
||||
return hn.cmd.Process.Kill()
|
||||
}
|
||||
|
||||
// KillAndWait kills the lnd process and waits for it to finish.
|
||||
func (hn *HarnessNode) KillAndWait() error {
|
||||
err := hn.cmd.Process.Kill()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = hn.cmd.Process.Wait()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// printErrf prints an error to the console.
|
||||
func (hn *HarnessNode) printErrf(format string, a ...interface{}) {
|
||||
fmt.Printf("itest error from [%s:%s]: %s\n", //nolint:forbidigo
|
||||
|
||||
Reference in new issue
Block a user