File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -119,11 +119,10 @@ def func_with_timeout(*args, **kwargs):
119119 # is deprecated, and should be treated the same as the `timeout`,
120120 # it is still possible for `deadline` argument in google.api_core.retry.Retry
121121 # to be larger than the `timeout`.
122- # Avoid setting negative timeout or timeout less than 5 seconds when the `timeout`
123- # has expired.
124122 # See https://github.com/googleapis/python-api-core/issues/654
125- # Revert back to the original timeout when this happens
126- if remaining_timeout < 5 :
123+ # Only positive non-zero timeouts are supported.
124+ # Revert back to the initial timeout for negative or 0 timeout values.
125+ if remaining_timeout < 1 :
127126 remaining_timeout = self ._timeout
128127
129128 kwargs ["timeout" ] = remaining_timeout
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def _clock():
8282 wrapped ()
8383 target .assert_called_with (timeout = 41.0 )
8484 wrapped ()
85- target .assert_called_with (timeout = 42 .0 )
85+ target .assert_called_with (timeout = 3 .0 )
8686 wrapped ()
8787 target .assert_called_with (timeout = 42.0 )
8888 wrapped ()
You can’t perform that action at this time.
0 commit comments