etcd: Wait for server to be stopped in tests.

This commit is contained in:
Joachim Bauch 2024-05-14 16:12:31 +02:00
parent 307ffdc29a
commit a50d637107
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 2 additions and 0 deletions

View file

@ -105,6 +105,7 @@ func NewEtcdForTest(t *testing.T) *embed.Etcd {
t.Cleanup(func() {
etcd.Close()
<-etcd.Server.StopNotify()
})
// Wait for server to be ready.
<-etcd.Server.ReadyNotify()

View file

@ -102,6 +102,7 @@ func newEtcdForTesting(t *testing.T) *embed.Etcd {
t.Cleanup(func() {
etcd.Close()
<-etcd.Server.StopNotify()
})
// Wait for server to be ready.
<-etcd.Server.ReadyNotify()