Skip to content

Commit f0d3b75

Browse files
authored
fix: avoid big grpc response error (#848)
Co-authored-by: Rick <[email protected]>
1 parent 319dbaf commit f0d3b75

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/testing/remote/grpc_store.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"errors"
2222
"fmt"
23+
"math"
2324
"strconv"
2425
"time"
2526

@@ -29,6 +30,7 @@ import (
2930
"github.com/linuxsuren/api-testing/pkg/testing"
3031

3132
"google.golang.org/grpc"
33+
"google.golang.org/grpc/credentials/insecure"
3234
)
3335

3436
var (
@@ -51,7 +53,10 @@ func (g *gRPCLoader) NewInstance(store testing.Store) (writer testing.Writer, er
5153
address := store.Kind.URL
5254

5355
var conn *grpc.ClientConn
54-
if conn, err = grpc.Dial(address, grpc.WithInsecure()); err == nil {
56+
57+
dialOption := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials()),
58+
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt))}
59+
if conn, err = grpc.Dial(address, dialOption...); err == nil {
5560
writer = &gRPCLoader{
5661
store: &store,
5762
ctx: WithStoreContext(context.Background(), &store),

0 commit comments

Comments
 (0)