mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #19187 from wojtek-t/add_sleep_in_etcd_server
Add sleep to EtcdTestServer Terminate.
This commit is contained in:
commit
4606171ad0
@ -146,6 +146,13 @@ func (m *EtcdTestServer) waitUntilUp() error {
|
|||||||
func (m *EtcdTestServer) Terminate(t *testing.T) {
|
func (m *EtcdTestServer) Terminate(t *testing.T) {
|
||||||
m.Client = nil
|
m.Client = nil
|
||||||
m.s.Stop()
|
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 {
|
for _, hs := range m.hss {
|
||||||
hs.CloseClientConnections()
|
hs.CloseClientConnections()
|
||||||
hs.Close()
|
hs.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user