Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

samples.snippets.subscriber_test: test_receive_with_blocking_shutdown failed #462

Copy link
Copy link

Description

@flaky-bot
Issue body actions

Note: #441 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: 2f180df
buildURL: Build Status, Sponge
status: failed

Test output
publisher_client = 
topic = 'projects/python-docs-samples-tests/topics/subscription-test-topic-3.8-7caeeb931df34a1f9c660ec6c5a91847'
subscription_async = 'projects/python-docs-samples-tests/subscriptions/subscription-test-subscription-async-3.8-7caeeb931df34a1f9c660ec6c5a91847'
capsys = <_pytest.capture.CaptureFixture object at 0x7fddcc73b430>
def test_receive_with_blocking_shutdown(
    publisher_client, topic, subscription_async, capsys
):
    _publish_messages(publisher_client, topic, message_num=3)

    subscriber.receive_messages_with_blocking_shutdown(
        PROJECT_ID, SUBSCRIPTION_ASYNC, timeout=5.0
    )

    out, _ = capsys.readouterr()
    out_lines = out.splitlines()

    msg_received_lines = [
        i for i, line in enumerate(out_lines)
        if re.search(r".*received.*message.*", line, flags=re.IGNORECASE)
    ]
    msg_done_lines = [
        i for i, line in enumerate(out_lines)
        if re.search(r".*done processing.*message.*", line, flags=re.IGNORECASE)
    ]
    stream_canceled_lines = [
        i for i, line in enumerate(out_lines)
        if re.search(r".*streaming pull future canceled.*", line, flags=re.IGNORECASE)
    ]
    shutdown_done_waiting_lines = [
        i for i, line in enumerate(out_lines)
        if re.search(r".*done waiting.*stream shutdown.*", line, flags=re.IGNORECASE)
    ]

    try:
        assert "Listening" in out
        assert subscription_async in out

        assert len(stream_canceled_lines) == 1
        assert len(shutdown_done_waiting_lines) == 1
      assert len(msg_received_lines) == 3

E assert 8 == 3
E + where 8 = len([2, 3, 4, 5, 6, 7, ...])

subscriber_test.py:435: AssertionError

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.flakybot: flakyTells the Flaky Bot not to close or comment on this issue.Tells the Flaky Bot not to close or comment on this issue.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.An issue filed by the Flaky Bot. Should not be added manually.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.Issues that are directly related to samples.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.