Commit 4606171a authored by Marek Grabowski's avatar Marek Grabowski

Merge pull request #19187 from wojtek-t/add_sleep_in_etcd_server

Add sleep to EtcdTestServer Terminate.
parents cd097e3f c8ad3116
......@@ -146,6 +146,13 @@ func (m *EtcdTestServer) waitUntilUp() error {
func (m *EtcdTestServer) Terminate(t *testing.T) {
m.Client = nil
m.s.Stop()
// TODO: This is a pretty ugly hack to workaround races during closing
// in-memory etcd server in unit tests - see #18928 for more details.
// We should get rid of it as soon as we have a proper fix - etcd clients
// have overwritten transport counting opened connections (probably by
// overwriting Dial function) and termination function waiting for all
// connections to be closed and stopping accepting new ones.
time.Sleep(250 * time.Millisecond)
for _, hs := range m.hss {
hs.CloseClientConnections()
hs.Close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment