mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Workaround races while closing etcd server.
This commit is contained in:
parent
05609cbf44
commit
c8ad31161b
@ -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