Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7beb20f

Browse files
author
Clayton Walker
committed
fix: add ChunkedEncodingError to list of retryable exceptions
1 parent5370979 commit7beb20f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

‎gitlab/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def http_request(
694694
stream=streamed,
695695
**opts,
696696
)
697-
exceptrequests.ConnectionError:
697+
except(requests.ConnectionError,requests.exceptions.ChunkedEncodingError):
698698
ifretry_transient_errorsand (
699699
max_retries==-1orcur_retries<max_retries
700700
):

‎tests/unit/test_gitlab_http_methods.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,16 @@ def request_callback(request):
9999

100100

101101
@responses.activate
102-
deftest_http_request_with_retry_on_method_for_transient_network_failures(gl):
102+
@pytest.mark.parametrize(
103+
"exception",
104+
[
105+
requests.ConnectionError("Connection aborted."),
106+
requests.exceptions.ChunkedEncodingError("Connection broken."),
107+
],
108+
)
109+
deftest_http_request_with_retry_on_method_for_transient_network_failures(
110+
gl,exception
111+
):
103112
call_count=0
104113
calls_before_success=3
105114

@@ -114,7 +123,7 @@ def request_callback(request):
114123

115124
ifcall_count>=calls_before_success:
116125
return (status_code,headers,body)
117-
raiserequests.ConnectionError("Connection aborted.")
126+
raiseexception
118127

119128
responses.add_callback(
120129
method=responses.GET,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp