Skip to content

Commit

Permalink
Merge pull request #8714 from dolthub/aaron/reliable-test-perf-fix
Browse files Browse the repository at this point in the history
[no-release-notes] go/libraries/doltcore/remotestorage/internal/reliable: grpc_test.go: Improve perf of NestErrorStreams so that it works and does not take forever.
  • Loading branch information
reltuk authored Jan 6, 2025
2 parents 1021c53 + 523a6c0 commit dab16ea
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 dab16ea

Please sign in to comment.