Skip to content

Commit

Permalink
change test case timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
DDH13 committed Mar 26, 2024
1 parent eed071d commit fc2d727
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/integration/integration/tests/grpc-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var GRPCAPI = suite.IntegrationTest{
},
}

func invokeGRPCClient(gwAddr string, t *testing.T) (*student.StudentResponse, error) {
func invokeGRPCClient(gwAddr string, t *testing.T, timeout config.TimeoutConfig) (*student.StudentResponse, error) {

t.Logf("Starting gRPC client...")

Expand Down Expand Up @@ -129,16 +129,18 @@ func invokeGRPCClient(gwAddr string, t *testing.T) (*student.StudentResponse, er
}

func invokeGRPCClientUntilSatisfied(gwAddr string, t *testing.T, testCase grpcutils.GRPCTestCase, timeout config.TimeoutConfig) {
//(delay to allow CRs to be applied)
time.Sleep(5 * time.Second)
var out *student.StudentResponse
var err error
attempt := 0
maxAttempts := 4
expected := testCase.ExpectedResponse
//timeoutDuration := timeout.RequestTimeout * time.Second
timeoutDuration := 10 * time.Second
timeoutDuration := 50 * time.Second
for attempt < maxAttempts {
t.Logf("Attempt %d to invoke gRPC client...", attempt+1)
out, err = invokeGRPCClient(gwAddr, t)
out, err = invokeGRPCClient(gwAddr, t, timeout)

if err != nil {
t.Logf("Error on attempt %d: %v", attempt+1, err)
Expand Down

0 comments on commit fc2d727

Please sign in to comment.