Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parallel integration test run #8

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions grpc/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ func (*FiberCodec) Name() string {
}

func (fc *FiberCodec) getDefaultCodec() encoding.Codec {
if fc.defaultCodec == nil {
fc.defaultCodec = encoding.GetCodec("proto")
}
return fc.defaultCodec
}

func NewFiberCodec() *FiberCodec {
return &FiberCodec{
defaultCodec: encoding.GetCodec("proto"),
}
}
2 changes: 1 addition & 1 deletion grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

func init() {
encoding.RegisterCodec(&FiberCodec{})
encoding.RegisterCodec(NewFiberCodec())
}

const (
Expand Down
9 changes: 3 additions & 6 deletions integration_test/fibergrpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ routes:
type: PROXY
timeout: "2s"
endpoint: "localhost:50555"
service: "testproto.UniversalPredictionService"
method: "PredictValues"
service_method: "testproto.UniversalPredictionService/PredictValues"
protocol: "grpc"
- id: route2
type: PROXY
timeout: "2s"
endpoint: "localhost:50556"
service: "testproto.UniversalPredictionService"
method: "PredictValues"
service_method: "testproto.UniversalPredictionService/PredictValues"
protocol: "grpc"
- id: route3
type: PROXY
timeout: "2s"
endpoint: "localhost:50557"
service: "testproto.UniversalPredictionService"
method: "PredictValues"
service_method: "testproto.UniversalPredictionService/PredictValues"
protocol: "grpc"
1 change: 1 addition & 0 deletions integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func TestE2EFromConfig(t *testing.T) {
}

for _, tt := range tests {
tt := tt // Capture range variable locally for parallelizing the tests
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down