test for TotalQpsLimitExceeded

This commit is contained in:
Sema Checherinda 2024-05-28 17:58:32 +02:00
parent 554a8cd7c2
commit 6b8ca302d2
3 changed files with 18 additions and 1 deletions

2
contrib/aws vendored

@ -1 +1 @@
Subproject commit eb96e740453ae27afa1f367ba19f99bdcb38484d
Subproject commit deeaa9e7c5fe690e3dacc4005d7ecfa7a66a32bb

View File

@ -195,6 +195,18 @@ class _ServerRuntime:
)
request_handler.write_error(429, data)
class TotalQpsLimitExceededAction:
def inject_error(self, request_handler):
data = (
'<?xml version="1.0" encoding="UTF-8"?>'
"<Error>"
"<Code>TotalQpsLimitExceeded</Code>"
"<Message>Please reduce your request rate.</Message>"
"<RequestId>txfbd566d03042474888193-00608d7537</RequestId>"
"</Error>"
)
request_handler.write_error(429, data)
class RedirectAction:
def __init__(self, host="localhost", port=1):
self.dst_host = _and_then(host, str)
@ -269,6 +281,10 @@ class _ServerRuntime:
self.error_handler = _ServerRuntime.QpsLimitExceededAction(
*self.action_args
)
elif self.action == "total_qps_limit_exceeded":
self.error_handler = _ServerRuntime.TotalQpsLimitExceededAction(
*self.action_args
)
else:
self.error_handler = _ServerRuntime.Expected500ErrorAction()

View File

@ -205,6 +205,7 @@ def test_upload_s3_fail_upload_part_when_multi_part_upload(
[
("slow_down", "DB::Exception: Slow Down."),
("qps_limit_exceeded", "DB::Exception: Please reduce your request rate."),
("total_qps_limit_exceeded", "DB::Exception: Please reduce your request rate."),
(
"connection_refused",
"Poco::Exception. Code: 1000, e.code() = 111, Connection refused",