chore: sync testing plan with gateway
This commit is contained in:
@@ -234,16 +234,27 @@ func (g runningAuthenticatedGateway) stop(t *testing.T) {
|
||||
func dialGatewayClient(t *testing.T, addr string) *grpc.ClientConn {
|
||||
t.Helper()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
var conn *grpc.ClientConn
|
||||
require.Eventually(t, func() bool {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
|
||||
defer cancel()
|
||||
|
||||
conn, err := grpc.DialContext(
|
||||
ctx,
|
||||
addr,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithBlock(),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
candidate, err := grpc.DialContext(
|
||||
ctx,
|
||||
addr,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithBlock(),
|
||||
)
|
||||
if err != nil {
|
||||
if candidate != nil {
|
||||
_ = candidate.Close()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
conn = candidate
|
||||
return true
|
||||
}, 2*time.Second, 10*time.Millisecond, "gateway did not accept gRPC connections")
|
||||
|
||||
return conn
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user