Skip to content

Commit

Permalink
Merge pull request #1040 from menghanl/interop_change
Browse files Browse the repository at this point in the history
call cancel on context in DoTimeoutOnSleepingServer
  • Loading branch information
iamqizhao authored Jan 5, 2017
2 parents c810507 + ec1de5b commit 85497e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion interop/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func DoEmptyStream(tc testpb.TestServiceClient, args ...grpc.CallOption) {

// DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout.
func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOption) {
ctx, _ := context.WithTimeout(context.Background(), 1*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond)
defer cancel()
stream, err := tc.FullDuplexCall(ctx, args...)
if err != nil {
if grpc.Code(err) == codes.DeadlineExceeded {
Expand Down

0 comments on commit 85497e2

Please sign in to comment.