Skip to content

Conversation

@samanthamcq
Copy link
Collaborator

@samanthamcq samanthamcq commented Dec 11, 2024

ASOC-2886 - Fixed an issue with the SDK that was either not working or failing intermittently. Added retries (up to 10 times) for queries, but skips retries for mutations.

return records


@retry(stop=stop_after_attempt(10), wait=wait_fixed(10), retry=retry_if_exception(is_not_breakout_exception))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is too many retries, maybe 3? 5? how long does the test take to run?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 5

Comment on lines +78 to +79
# Call the function and expect a RetryError
with pytest.raises(tenacity.RetryError) as excinfo:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this test takes too long to run (cause of all the retries) you can add a send_graphql_query.retry.wait = wait_fixed(0) in the test itself to override the wait

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only takes couple minutes.

# Assertion
assert str(excinfo.value) == "Error: 500 - Internal Server Error"
# Check the inner exception message
inner_exception = excinfo.value.last_attempt.exception()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also assert the number of calls to post here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@samanthamcq samanthamcq merged commit f1b277f into main Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants