Ensure process is stopped before detaching in tests
This commit is contained in:
parent
b35a743a3c
commit
72b81c0c6b
@ -26,7 +26,10 @@ func withTestProcess(name string, t *testing.T, fn func(p *Process, fixture prot
|
|||||||
t.Fatal("Launch():", err)
|
t.Fatal("Launch():", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer p.Detach(true)
|
defer func() {
|
||||||
|
p.Halt()
|
||||||
|
p.Detach(true)
|
||||||
|
}()
|
||||||
|
|
||||||
fn(p, fixture)
|
fn(p, fixture)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,10 @@ func withTestClient(name string, t *testing.T, fn func(c service.Client)) {
|
|||||||
}, false)
|
}, false)
|
||||||
go server.Run()
|
go server.Run()
|
||||||
client := rpc.NewClient(listener.Addr().String())
|
client := rpc.NewClient(listener.Addr().String())
|
||||||
defer client.Detach(true)
|
defer func() {
|
||||||
|
client.Detach(true)
|
||||||
|
}()
|
||||||
|
|
||||||
fn(client)
|
fn(client)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user