Skip to content

Commit

Permalink
Bug: Fix wrong judgement about retryable server error
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Sep 24, 2024
1 parent fa3a688 commit 14b1250
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tosfs/tests/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@
("exception", "expected"),
[
(
TosServerError(
response,
"Exceed account external rate limit. Too much throughput in a "
"short period of time, please slow down.",
"ExceedAccountExternalRateLimit",
"KmsJSKDKhjasdlKmsduwRETYHB",
"",
"0004-00000001",
),
True,
TosServerError(
response,
"Exceed account external rate limit. Too much throughput in a "
"short period of time, please slow down.",
"ExceedAccountExternalRateLimit",
"KmsJSKDKhjasdlKmsduwRETYHB",
"",
"0004-00000001",
),
True,
),
(
TosClientError(
"http request timeout",
ConnectionError(
ProtocolError(
"Connection aborted.",
ConnectionResetError(104, "Connection reset by peer"),
)
),
TosClientError(
"http request timeout",
ConnectionError(
ProtocolError(
"Connection aborted.",
ConnectionResetError(104, "Connection reset by peer"),
)
),
True,
),
True,
),
],
)
def test_is_retry_exception(
exception,
expected,
exception,
expected,
):
assert is_retryable_exception(exception) == expected

0 comments on commit 14b1250

Please sign in to comment.