chore: improve docker test shutdown reliability (#4576)
This commit is contained in:
@@ -75,7 +75,9 @@ func runRedis(t testing.TB) string {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
_ = c.Close(t.Context())
|
// t.Context() is canceled before cleanup funcs run, so use a
|
||||||
|
// non-canceled context to let the container stop/remove complete.
|
||||||
|
_ = c.Close(context.Background())
|
||||||
})
|
})
|
||||||
addr := c.GetHostPort("6379/tcp")
|
addr := c.GetHostPort("6379/tcp")
|
||||||
waitTCPPort(t, addr)
|
waitTCPPort(t, addr)
|
||||||
|
|||||||
Reference in New Issue
Block a user