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

Tests: Remove shared subscriptions across parallel tests #669

Merged
merged 35 commits into from
May 16, 2022

Conversation

acocuzzo
Copy link
Contributor

@acocuzzo acocuzzo commented Apr 22, 2022

In samples/snippets/noxfile.py, tests are run in parallel if pytest-parallel is installed.

This resulted in tests failing in CI that did not fail locally. Because of the use of shared subscription names across tests running in parallel, some tests were deleting a subscription, while others were attempting to receive messages.

This PR removes all subscription test fixtures that created and deleted subscriptions that were reused across tests in samples/snippets/subscriber_test.py, instead repeating the creation logic within each test, with a different subscription name per test, to allow tests to run in parallel without failures.

Also includes unrelated formatting changes due to linting changes.

Fixes #668🦕

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: pubsub Issues related to the googleapis/python-pubsub API. labels Apr 22, 2022
@acocuzzo acocuzzo changed the title Samples tests deflake Samples (tests) : Remove shared subscriptions across parallel tests Apr 22, 2022
@acocuzzo acocuzzo changed the title Samples (tests) : Remove shared subscriptions across parallel tests Tests: Remove shared subscriptions across parallel tests Apr 22, 2022
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Apr 22, 2022
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: xl Pull request size is extra large. labels Apr 22, 2022
@acocuzzo acocuzzo marked this pull request as ready for review April 23, 2022 02:20
@acocuzzo acocuzzo requested review from a team as code owners April 23, 2022 02:20
@acocuzzo acocuzzo requested a review from kurtisvg April 23, 2022 02:20
@acocuzzo acocuzzo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2022
@acocuzzo acocuzzo added the kokoro:run Add this label to force Kokoro to re-run the tests. label Apr 25, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Apr 25, 2022
Copy link
Contributor

@pradn pradn left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@acocuzzo acocuzzo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 11, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 11, 2022
@acocuzzo acocuzzo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 12, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 12, 2022
@acocuzzo acocuzzo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 12, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 12, 2022
@pradn pradn merged commit 8513f53 into googleapis:main May 16, 2022
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. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Samples subscriber_test to remove parallel issues
5 participants