This commit is contained in:
iamqizhao 2015-08-03 13:24:14 -07:00 коммит произвёл yangzhouhan
Родитель 4297e9bd91
Коммит e6e95f0f21
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -243,7 +243,7 @@ func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState Conn
done := make(chan struct{})
go func() {
select {
case <-time.After(timeout-time.Since(start)):
case <-time.After(timeout - time.Since(start)):
cc.mu.Lock()
expired = true
cc.stateCV.Broadcast()

Просмотреть файл

@ -484,7 +484,7 @@ func testEmptyUnaryWithUserAgent(t *testing.T, e env) {
if ok := cc.WaitForStateChange(time.Second, grpc.Idle); !ok {
t.Fatalf("cc.WaitForStateChange(_, %s) = %t, want true", grpc.Idle, ok)
}
if ok := cc.WaitForStateChange(10 * time.Second, grpc.Connecting); !ok {
if ok := cc.WaitForStateChange(10*time.Second, grpc.Connecting); !ok {
t.Fatalf("cc.WaitForStateChange(_, %s) = %t, want true", grpc.Connecting, ok)
}
if cc.State() != grpc.Ready {
@ -503,7 +503,7 @@ func testEmptyUnaryWithUserAgent(t *testing.T, e env) {
t.Fatalf("header[\"ua\"] = %q, %t, want %q, true", v, ok, testAppUA)
}
tearDown(s, cc)
if ok := cc.WaitForStateChange(5 * time.Second, grpc.Ready); !ok {
if ok := cc.WaitForStateChange(5*time.Second, grpc.Ready); !ok {
t.Fatalf("cc.WaitForStateChange(_, %s) = %t, want true", grpc.Ready, ok)
}
if cc.State() != grpc.Shutdown {