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):
399
399
transport = self ._transport
400
400
base_retry = transport ._wrapped_methods [transport .publish ]._retry
401
401
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
402
406
elif retry is not None :
403
407
retry = retry .with_deadline (2.0 ** 32 )
408
+ timeout = 2.0 ** 32
404
409
405
410
# Delegate the publishing to the sequencer.
406
411
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):
316
316
expected_retry = custom_retry .with_deadline (2.0 ** 32 )
317
317
_assert_retries_equal (batch_commit_retry , expected_retry )
318
318
319
+ batch_commit_timeout = kwargs ["commit_timeout" ]
320
+ expected_timeout = 2.0 ** 32
321
+ assert batch_commit_timeout == pytest .approx (expected_timeout )
322
+
319
323
320
324
def test_publish_with_ordering_key_with_no_retry (creds ):
321
325
client = publisher .Client (
You can’t perform that action at this time.
0 commit comments