Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Fix flaky tests related to stubber out of order expectations #559

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

LaikaN57
Copy link
Member

boto3 Stubber expects calls to come in order. However, our code (or the underlying libraries) can do calls in a random order. This PR helps eliviate the in order expectations.

self.iam_stubber.add_client_error("list_user_policies", "400", "NoSuchEntity")
self.iam_stubber.activate()
ret = yield self.actor._get_entity_policies("test")
self.assertEqual(ret, {})

@testing.gen_test
def test_get_entities_other_500(self):
self.iam_stubber.add_client_error("list_user_policies", "400", "NoSuchEntity")
Copy link
Member Author

Choose a reason for hiding this comment

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

this line was a typo

@@ -74,26 +74,23 @@ def test_get_entity_policies_500(self):

@testing.gen_test
def test_get_entity_policies_400(self):
# Next, what if the entity doesn't exist at all?
self.iam_stubber = Stubber(self.actor.iam_conn)
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed to standardize on common Stubber.

@LaikaN57 LaikaN57 merged commit 23a837a into main Feb 12, 2025
3 checks passed
@LaikaN57 LaikaN57 deleted the adk-fix-flaky-tests branch February 12, 2025 12:02
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.

1 participant