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