Skip to content
This repository was archived by the owner on Oct 13, 2026. It is now read-only.
This repository was archived by the owner on Oct 13, 2026. It is now read-only.

subscriber_test.test_receive_messages_with_exactly_once_delivery_enabled unit flaky #636

Closed

Description

@acocuzzo

Samples unit test fails since PR #629

regional_publisher_client = <google.cloud.pubsub_v1.PublisherClient object at 0x7fcdbe671ca0>
exactly_once_delivery_topic = 'projects/python-docs-samples-tests/topics/subscription-test-eod-topic-3.9-9bea132264a14256be2578f16fc56344'
subscription_eod = 'projects/python-docs-samples-tests/subscriptions/subscription-test-subscription-eod-3.9-9bea132264a14256be2578f16fc56344'
capsys = <_pytest.capture.CaptureFixture object at 0x7fcdbe55ab20>

    def test_receive_messages_with_exactly_once_delivery_enabled(
        regional_publisher_client: pubsub_v1.PublisherClient,
        exactly_once_delivery_topic: str,
        subscription_eod: str,
        capsys: CaptureFixture[str],
    ) -> None:

        message_ids = _publish_messages(regional_publisher_client, exactly_once_delivery_topic)

>       subscriber.receive_messages_with_exactly_once_delivery_enabled(
            PROJECT_ID, SUBSCRIPTION_EOD, 10
        )

subscriber_test.py:715:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
subscriber.py:662: in receive_messages_with_exactly_once_delivery_enabled
    streaming_pull_future.result(timeout=timeout)
/usr/local/lib/python3.9/concurrent/futures/_base.py:445: in result
    return self.__get_result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = None

    def __get_result(self):
        if self._exception:
            try:
>               raise self._exception
E               google.api_core.exceptions.NotFound: 404 Resource not found (resource=projects/python-docs-samples-tests/subscriptions/subscription-test-subscription-eod-3.9-9bea132264a14256be2578f16fc56344).

/usr/local/lib/python3.9/concurrent/futures/_base.py:390: NotFound

I suspect this may be due to a change in the test in: PR #628
or exactly once behavior in PR #626.

Activity

  1. added
    api: pubsubIssues related to the googleapis/python-pubsub API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Apr 5, 2022
  2. self-assigned this
    on Apr 5, 2022
  3. linked a pull request that will close this issueci: fix unit test breakages #637on Apr 5, 2022
  4. added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Apr 5, 2022
  5. changed the title [-]3.7 and 3.8 unit tests broken from PR #634[/-] [+]subscriber_test.test_receive_messages_with_exactly_once_delivery_enabled unit test broken[/+] on Apr 5, 2022
  6. changed the title [-]subscriber_test.test_receive_messages_with_exactly_once_delivery_enabled unit test broken[/-] [+]subscriber_test.test_receive_messages_with_exactly_once_delivery_enabled unit flaky[/+] on Apr 5, 2022
  7. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Apr 5, 2022
  8. acocuzzo commented on Apr 22, 2022

    @acocuzzo
    ContributorAuthor

    In samples noxfile, tests are run in parallel if pytest-paralllel is installed

    Since test fixtures created subscriptions with the same name for different tests running in parallel, subscriptions were being deleted in some tests while other tests were attempting to receive messages, which resulted in "Not Found" errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.flakypriority: p2Moderately-important priority. Fix may not be included in next release.testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Sponsor
    SponsoredKunjungi sekarang
    Promo