Skip to content

Commit f2856ea

Browse files
committed
Wait for process to exit when killing it
1 parent e25c0fa commit f2856ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

testserver/testservernode.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ func (ts *testServerImpl) StopNode(nodeNum int) error {
2929

3030
// Kill the process.
3131
if cmd.Process != nil {
32-
return cmd.Process.Kill()
32+
if err := cmd.Process.Kill(); err != nil {
33+
return err
34+
}
35+
if _, err := cmd.Process.Wait(); err != nil {
36+
return err
37+
}
3338
}
3439

3540
return nil

0 commit comments

Comments
 (0)