mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Check grpc server ready properly
This commit is contained in:
@@ -70,7 +70,7 @@ func (m *Stub) Start() error {
|
|||||||
// Wait till grpc server is ready.
|
// Wait till grpc server is ready.
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
services := m.server.GetServiceInfo()
|
services := m.server.GetServiceInfo()
|
||||||
if len(services) > 1 {
|
if len(services) > 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
|
@@ -90,20 +90,12 @@ func TestRun(t *testing.T) {
|
|||||||
|
|
||||||
go e.run()
|
go e.run()
|
||||||
// Wait for the first callback to be issued.
|
// Wait for the first callback to be issued.
|
||||||
select {
|
<-callbackChan
|
||||||
case <-callbackChan:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
p.Update(updated)
|
p.Update(updated)
|
||||||
|
|
||||||
// Wait for the second callback to be issued.
|
// Wait for the second callback to be issued.
|
||||||
select {
|
<-callbackChan
|
||||||
case <-callbackChan:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
|
|
||||||
e.mutex.Lock()
|
e.mutex.Lock()
|
||||||
defer e.mutex.Unlock()
|
defer e.mutex.Unlock()
|
||||||
|
Reference in New Issue
Block a user