4343SUBSCRIPTION_EOD = f"subscription-test-subscription-eod-{ PY_VERSION } -{ UUID } "
4444ENDPOINT = f"https://{ PROJECT_ID } .appspot.com/push"
4545NEW_ENDPOINT = f"https://{ PROJECT_ID } .appspot.com/push2"
46+ REGIONAL_ENDPOINT = "us-east1-pubsub.googleapis.com:443"
4647DEFAULT_MAX_DELIVERY_ATTEMPTS = 5
4748UPDATED_MAX_DELIVERY_ATTEMPTS = 20
4849FILTER = 'attributes.author="unknown"'
@@ -59,7 +60,7 @@ def publisher_client() -> Generator[pubsub_v1.PublisherClient, None, None]:
5960
6061@pytest .fixture (scope = "module" )
6162def regional_publisher_client () -> Generator [pubsub_v1 .PublisherClient , None , None ]:
62- client_options = {"api_endpoint" : "us-east1-pubsub.googleapis.com:443" }
63+ client_options = {"api_endpoint" : REGIONAL_ENDPOINT }
6364 publisher = pubsub_v1 .PublisherClient (client_options = client_options )
6465 yield publisher
6566
@@ -703,7 +704,8 @@ def eventually_consistent_test() -> None:
703704 eventually_consistent_test ()
704705
705706
706- def test_receive_messages_with_exactly_once_delivery_enabled (
707+ @typed_flaky
708+ def test_receive_messages_with_exactly_once_delivery_enabled_regional_endpoint (
707709 regional_publisher_client : pubsub_v1 .PublisherClient ,
708710 exactly_once_delivery_topic : str ,
709711 subscription_eod : str ,
@@ -722,6 +724,25 @@ def test_receive_messages_with_exactly_once_delivery_enabled(
722724 assert message_id in out
723725
724726
727+ def test_receive_messages_with_exactly_once_delivery_enabled (
728+ publisher_client : pubsub_v1 .PublisherClient ,
729+ exactly_once_delivery_topic : str ,
730+ subscription_eod : str ,
731+ capsys : CaptureFixture [str ],
732+ ) -> None :
733+
734+ message_ids = _publish_messages (publisher_client , exactly_once_delivery_topic )
735+
736+ subscriber .receive_messages_with_exactly_once_delivery_enabled (
737+ PROJECT_ID , SUBSCRIPTION_EOD , 10
738+ )
739+
740+ out , _ = capsys .readouterr ()
741+ assert subscription_eod in out
742+ for message_id in message_ids :
743+ assert message_id in out
744+
745+
725746def test_listen_for_errors (
726747 publisher_client : pubsub_v1 .PublisherClient ,
727748 topic : str ,
0 commit comments