This repository was archived by the owner on Mar 9, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
google/cloud/pubsub_v1/publisher
tests/unit/pubsub_v1/publisher Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -399,8 +399,13 @@ def on_publish_done(future):
399399 transport = self ._transport
400400 base_retry = transport ._wrapped_methods [transport .publish ]._retry
401401 retry = base_retry .with_deadline (2.0 ** 32 )
402+ # timeout needs to be overridden and set to infinite in
403+ # addition to the retry deadline since both determine
404+ # the duration for which retries are attempted.
405+ timeout = 2.0 ** 32
402406 elif retry is not None :
403407 retry = retry .with_deadline (2.0 ** 32 )
408+ timeout = 2.0 ** 32
404409
405410 # Delegate the publishing to the sequencer.
406411 sequencer = self ._get_or_create_sequencer (topic , ordering_key )
Original file line number Diff line number Diff line change @@ -316,6 +316,10 @@ def test_publish_with_ordering_key_uses_extended_retry_deadline(creds):
316316 expected_retry = custom_retry .with_deadline (2.0 ** 32 )
317317 _assert_retries_equal (batch_commit_retry , expected_retry )
318318
319+ batch_commit_timeout = kwargs ["commit_timeout" ]
320+ expected_timeout = 2.0 ** 32
321+ assert batch_commit_timeout == pytest .approx (expected_timeout )
322+
319323
320324def test_publish_with_ordering_key_with_no_retry (creds ):
321325 client = publisher .Client (
You can’t perform that action at this time.
0 commit comments