Skip to content

Commit

Permalink
go/libraries/doltcore/remotestorage/internal/reliable: grpc_test.go: …
Browse files Browse the repository at this point in the history
…Improve perf of NestErrorStreams so that it works and does not take forever.
  • Loading branch information
reltuk committed Jan 4, 2025
1 parent 4abb441 commit 523a6c0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions go/libraries/doltcore/remotestorage/internal/reliable/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ func TestMakeCall(t *testing.T) {
Open: func(ctx context.Context, opts ...grpc.CallOption) (ClientStream[int, int], error) {
return newTestStream[int](ctx, rand.IntN(8)), nil
},
ReadRequestTimeout: 5 * time.Second,
DeliverRespTimeout: 5 * time.Second,
})
}
recvError := func(ctx context.Context, opts ...grpc.CallOption) (ClientStream[int, int], error) {
Expand All @@ -345,6 +347,8 @@ func TestMakeCall(t *testing.T) {
err: errors.New("an error after recving"),
}, nil
},
ReadRequestTimeout: 5 * time.Second,
DeliverRespTimeout: 5 * time.Second,
})
}
sendError := func(ctx context.Context, opts ...grpc.CallOption) (ClientStream[int, int], error) {
Expand All @@ -362,13 +366,17 @@ func TestMakeCall(t *testing.T) {
err: errors.New("an error after recving"),
}, nil
},
ReadRequestTimeout: 5 * time.Second,
DeliverRespTimeout: 5 * time.Second,
})
}

stream, err := MakeCall(context.Background(), CallOptions[int, int]{
ErrF: errF,
BackOffF: backOffF,
Open: sendError,
ErrF: errF,
BackOffF: backOffF,
Open: sendError,
ReadRequestTimeout: 5 * time.Second,
DeliverRespTimeout: 5 * time.Second,
})
assert.NotNil(t, stream)
assert.NoError(t, err)
Expand Down

0 comments on commit 523a6c0

Please sign in to comment.