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(sample): mitigate flakiness in subscriber_test #304

Merged
merged 6 commits into from Mar 2, 2021

Conversation

@tmatsuo
Copy link
Member

@tmatsuo tmatsuo commented Mar 2, 2021

fixes #289
fixes #288

I think there were few problems with the tests.

  1. google.api_core.exceptions.Unknown is not retried.
  2. number of messages published in test_receive_synchronously_with_lease
    was 5, but the sample code is fetching 3 messages in bulk.
  3. assertion in test_receive_synchronously_with_lease was too strict.
  4. failure in subscriber_test was incorrectly considered a failure in
    teardown of quickstart_test.

I hope these changes will mitigate the flakiness.

fixes googleapis#289
fixes googleapis#288

I think there were few problems with the tests.

1. google.api_core.exceptions.Unknown is not retried.
2. number of messages published in test_receive_synchronously_with_lease
   was 5, but the sample code is fetching 3 messages in bulk.
3. assertion in test_receive_synchronously_with_lease was too strict.
4. failure in subscriber_test was incorrectly considered a failure in
   teardown of quickstart_test.

I hope these changes will mitigate the flakiness.
@tmatsuo tmatsuo requested a review from anguillanneuf Mar 2, 2021
@tmatsuo tmatsuo requested a review from as a code owner Mar 2, 2021
@tmatsuo tmatsuo requested review from engelke and removed request for Mar 2, 2021
@google-cla google-cla bot added the cla: yes label Mar 2, 2021
Copy link
Contributor

@anguillanneuf anguillanneuf left a comment

Yah, with sync pull, we may not get the specified number of messages, so the test is too strict there.

Using unknown is also better.

LGTM.

Loading

@anguillanneuf
Copy link
Contributor

@anguillanneuf anguillanneuf commented Mar 2, 2021

I LGTM'ed too early. Tests are still flaky (might have become flakier)

Loading

@anguillanneuf anguillanneuf self-requested a review Mar 2, 2021
@tmatsuo
Copy link
Member Author

@tmatsuo tmatsuo commented Mar 2, 2021

@busunkim96 There is another instnace of Unkown and stream removed.

Loading

@tmatsuo
Copy link
Member Author

@tmatsuo tmatsuo commented Mar 2, 2021

Loading

@anguillanneuf anguillanneuf merged commit 271a385 into googleapis:master Mar 2, 2021
8 checks passed
Loading
@tmatsuo tmatsuo deleted the fix-sample-test branch Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants