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

samples(test): correct subscription type in exactly once delivery test #619

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

anguillanneuf
Copy link
Contributor

Fixes #616

@anguillanneuf anguillanneuf requested review from a team as code owners March 18, 2022 00:16
@product-auto-label product-auto-label bot added api: pubsub Issues related to the googleapis/python-pubsub API. samples Issues that are directly related to samples. labels Mar 18, 2022
@anguillanneuf
Copy link
Contributor Author

anguillanneuf commented Mar 18, 2022

Test failure seems unrelated to the PR.

nox > mypy google/cloud
google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py:178: error: _ScalarV? has no attribute "startswith"
google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py:186: error: _ScalarV? has no attribute "future"
google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py:203: error: _ScalarV? has no attribute "future"
google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py:207: error: _ScalarV? has no attribute "future"
google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py:208: error: _ScalarV? has no attribute "future"
Found 5 errors in 1 file (checked 33 source files)
nox > Command mypy google/cloud failed with exit code 1

Fixed in #622

@@ -307,7 +354,7 @@ def test_receive_with_delivery_attempts(
# We keep retrying up to 10 minutes for mitigating the flakiness.
@typed_backoff
def run_sample() -> None:
_publish_messages(publisher_client, topic)
_ = _publish_messages(publisher_client, topic)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the return value need to be stored in _?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The returned messages IDs are only needed by one test. I changed them all because I added a return for the publish function. _ means in those other tests we don't care about the message IDs.

@anguillanneuf anguillanneuf merged commit 071300f into main Mar 23, 2022
@anguillanneuf anguillanneuf deleted the exactly-once-sample-test branch March 23, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exactly once delivery sample not using a subscription with exactly once delivery enabled
2 participants