Commit b96c383e authored by Penghao Cen's avatar Penghao Cen

Check grpc server ready properly

parent 90bc1265
......@@ -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()
......
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