modify a comment
This commit is contained in:
Родитель
9c6754e004
Коммит
591c1176bc
|
@ -304,9 +304,10 @@ func setUp(useTLS bool, maxStream uint32) (s *grpc.Server, tc testpb.TestService
|
|||
func TestTimeoutOnDeadServer(t *testing.T) {
|
||||
s, tc := setUp(false, math.MaxUint32)
|
||||
s.Stop()
|
||||
// Set a minimal deadline to make sure the context times out in the 1st
|
||||
// invoke of ClientConn.wait.
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Nanosecond)
|
||||
// Set -1 as the timeout to make sure if transportMonitor gets error
|
||||
// notification in time the failure path of the 1st invoke of
|
||||
// ClientConn.wait hits the deadline exceeded error.
|
||||
ctx, _ := context.WithTimeout(context.Background(), -1)
|
||||
if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded {
|
||||
t.Fatalf("TestService/EmptyCall(%v, _) = _, error %v, want _, error code: %d", ctx, err, codes.DeadlineExceeded)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче