mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
test for TotalQpsLimitExceeded
This commit is contained in:
parent
554a8cd7c2
commit
6b8ca302d2
2
contrib/aws
vendored
2
contrib/aws
vendored
@ -1 +1 @@
|
||||
Subproject commit eb96e740453ae27afa1f367ba19f99bdcb38484d
|
||||
Subproject commit deeaa9e7c5fe690e3dacc4005d7ecfa7a66a32bb
|
@ -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()
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user