|
51 | 51 | C = TypeVar("C", bound=Callable[..., Any]) |
52 | 52 |
|
53 | 53 | typed_flaky = cast(Callable[[C], C], flaky(max_runs=3, min_passes=1)) |
| 54 | +typed_super_flaky = cast(Callable[[C], C], flaky(max_runs=10, min_passes=10)) |
54 | 55 |
|
55 | 56 |
|
56 | 57 | @pytest.fixture(scope="module") |
@@ -704,33 +705,26 @@ def eventually_consistent_test() -> None: |
704 | 705 | eventually_consistent_test() |
705 | 706 |
|
706 | 707 |
|
| 708 | +@typed_super_flaky |
707 | 709 | def test_receive_messages_with_exactly_once_delivery_enabled( |
708 | 710 | regional_publisher_client: pubsub_v1.PublisherClient, |
709 | 711 | exactly_once_delivery_topic: str, |
710 | 712 | subscription_eod: str, |
711 | 713 | capsys: CaptureFixture[str], |
712 | 714 | ) -> None: |
713 | 715 |
|
714 | | - typed_backoff = cast( |
715 | | - Callable[[C], C], backoff.on_exception(backoff.expo, Unknown, max_time=300), |
| 716 | + message_ids = _publish_messages( |
| 717 | + regional_publisher_client, exactly_once_delivery_topic |
716 | 718 | ) |
717 | 719 |
|
718 | | - @typed_backoff |
719 | | - def eventually_consistent_test() -> None: |
720 | | - message_ids = _publish_messages( |
721 | | - regional_publisher_client, exactly_once_delivery_topic |
722 | | - ) |
723 | | - |
724 | | - subscriber.receive_messages_with_exactly_once_delivery_enabled( |
725 | | - PROJECT_ID, SUBSCRIPTION_EOD, 10 |
726 | | - ) |
727 | | - |
728 | | - out, _ = capsys.readouterr() |
729 | | - assert subscription_eod in out |
730 | | - for message_id in message_ids: |
731 | | - assert message_id in out |
| 720 | + subscriber.receive_messages_with_exactly_once_delivery_enabled( |
| 721 | + PROJECT_ID, SUBSCRIPTION_EOD, 200 |
| 722 | + ) |
732 | 723 |
|
733 | | - eventually_consistent_test() |
| 724 | + out, _ = capsys.readouterr() |
| 725 | + assert subscription_eod in out |
| 726 | + for message_id in message_ids: |
| 727 | + assert message_id in out |
734 | 728 |
|
735 | 729 |
|
736 | 730 | def test_listen_for_errors( |
|
0 commit comments