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

Commit07a16af

Browse files
authored
Merge pull request#1974 from Sineaggi/add-chunked-to-list-of-retryable-exceptions
Add ChunkedEncodingError to list of retryable exceptions
2 parents69ace2d +7beb20f commit07a16af

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
@@ -701,7 +701,7 @@ def http_request(
701701
stream=streamed,
702702
**opts,
703703
)
704-
exceptrequests.ConnectionError:
704+
except(requests.ConnectionError,requests.exceptions.ChunkedEncodingError):
705705
ifretry_transient_errorsand (
706706
max_retries==-1orcur_retries<max_retries
707707
):

‎tests/unit/test_gitlab_http_methods.py

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

103103

104104
@responses.activate
105-
deftest_http_request_with_retry_on_method_for_transient_network_failures(gl):
105+
@pytest.mark.parametrize(
106+
"exception",
107+
[
108+
requests.ConnectionError("Connection aborted."),
109+
requests.exceptions.ChunkedEncodingError("Connection broken."),
110+
],
111+
)
112+
deftest_http_request_with_retry_on_method_for_transient_network_failures(
113+
gl,exception
114+
):
106115
call_count=0
107116
calls_before_success=3
108117

@@ -117,7 +126,7 @@ def request_callback(request):
117126

118127
ifcall_count>=calls_before_success:
119128
return (status_code,headers,body)
120-
raiserequests.ConnectionError("Connection aborted.")
129+
raiseexception
121130

122131
responses.add_callback(
123132
method=responses.GET,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp