mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Add stupid retries in clickhouse-test health check.
This commit is contained in:
parent
ecc6ff707b
commit
e91cdb4f8d
@ -94,7 +94,7 @@ class HTTPError(Exception):
|
||||
|
||||
# Helpers to execute queries via HTTP interface.
|
||||
def clickhouse_execute_http(
|
||||
base_args, query, timeout=30, settings=None, default_format=None, max_http_retries=5
|
||||
base_args, query, timeout=30, settings=None, default_format=None, max_http_retries=5, retry_error_codes=False
|
||||
):
|
||||
if args.secure:
|
||||
client = http.client.HTTPSConnection(
|
||||
@ -131,7 +131,8 @@ def clickhouse_execute_http(
|
||||
)
|
||||
res = client.getresponse()
|
||||
data = res.read()
|
||||
break
|
||||
if res.status == 200 or (not retry_error_codes):
|
||||
break
|
||||
except Exception as ex:
|
||||
if i == max_http_retries - 1:
|
||||
raise ex
|
||||
@ -143,8 +144,8 @@ def clickhouse_execute_http(
|
||||
|
||||
return data
|
||||
|
||||
def clickhouse_execute(base_args, query, timeout=30, settings=None, max_http_retries=5):
|
||||
return clickhouse_execute_http(base_args, query, timeout, settings, max_http_retries=max_http_retries).strip()
|
||||
def clickhouse_execute(base_args, query, timeout=30, settings=None, max_http_retries=5, retry_error_codes=False):
|
||||
return clickhouse_execute_http(base_args, query, timeout, settings, max_http_retries=max_http_retries, retry_error_codes=retry_error_codes).strip()
|
||||
|
||||
|
||||
def clickhouse_execute_json(base_args, query, timeout=60, settings=None, max_http_retries=5):
|
||||
@ -1078,7 +1079,7 @@ class TestCase:
|
||||
@staticmethod
|
||||
def send_test_name_failed(suite: str, case: str):
|
||||
pid = os.getpid()
|
||||
clickhouse_execute(args, f"SELECT 'Running test {suite}/{case} from pid={pid}'")
|
||||
clickhouse_execute(args, f"SELECT 'Running test {suite}/{case} from pid={pid}'", retry_error_codes=True)
|
||||
|
||||
def run_single_test(
|
||||
self, server_logs_level, client_options
|
||||
|
Loading…
Reference in New Issue
Block a user