mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
test: fix flaky ipfswatch test (#11142)
Gracefully shutdown the ipfs node to ensure data is saved. Forceful shutdown is done if there is an error sending the interrupt signal to the process, such as on Windows.
This commit is contained in:
parent
447109df64
commit
56bf782cc6
@ -86,7 +86,9 @@ func TestIPFSWatch(t *testing.T) {
|
||||
|
||||
// Kill ipfswatch to release the repo lock
|
||||
if result.Cmd.Process != nil {
|
||||
_ = result.Cmd.Process.Kill()
|
||||
if err = result.Cmd.Process.Signal(os.Interrupt); err != nil {
|
||||
_ = result.Cmd.Process.Kill()
|
||||
}
|
||||
_, _ = result.Cmd.Process.Wait()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user