Skip to content

Commit

Permalink
Enable queued retries for custom schema tests (PAN-15263)
Browse files Browse the repository at this point in the history
Audit's `/v1/search` may HTTP/202 in the future so these tests should
be queueing retries.
  • Loading branch information
kenany committed Jun 25, 2024
1 parent 2d4fe10 commit 56daacf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pangea-sdk/v3/internal/pangeatesting/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ func IntegrationAuditVaultConfig(t *testing.T, env TestEnvironment) *pangea.Conf

func IntegrationCustomSchemaConfig(t *testing.T, env TestEnvironment) *pangea.Config {
return &pangea.Config{
HTTPClient: defaults.HTTPClient(),
Domain: GetTestDomain(t, env),
Token: GetCustomSchemaTestToken(t, env),
HTTPClient: defaults.HTTPClient(),
Domain: GetTestDomain(t, env),
Token: GetCustomSchemaTestToken(t, env),
QueuedRetryEnabled: true,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pangea-sdk/v3/pangea/pangea.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ func (c *Client) handledQueued(ctx context.Context, r *Response) (*Response, err
for r.HTTPResponse.StatusCode == http.StatusAccepted && !c.reachTimeout(start) {
delay := c.getDelay(retry, start)
if !pu.Sleep(delay, ctx) {
// If context closed, return inmediatly
// If context closed, return immediately.
return r, nil
}

Expand Down

0 comments on commit 56daacf

Please sign in to comment.