Skip to content

Commit

Permalink
add retry to poll result
Browse files Browse the repository at this point in the history
  • Loading branch information
pangea-andrest committed Jan 12, 2024
1 parent ae5c4f1 commit ccbf2ff
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pangea-sdk/v3/service/file_scan/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,20 @@ func Test_Integration_FileScan_NoRetry_reversinglabs(t *testing.T) {
assert.Nil(t, resp)
ae := err.(*pangea.AcceptedError)

// Wait until result should be ready
time.Sleep(time.Duration(40 * time.Second))
var pr *pangea.PangeaResponse[any]
i := 0

for i < 24 {
// Wait until result should be ready
time.Sleep(time.Duration(10 * time.Second))

pr, err = client.PollResultByError(ctx, *ae)
if err == nil {
break
}
i++
}

pr, err := client.PollResultByError(ctx, *ae)
assert.NoError(t, err)
assert.NotNil(t, pr)
assert.NotNil(t, pr.Result)
Expand Down

0 comments on commit ccbf2ff

Please sign in to comment.