Skip to content

Commit 81fcb0d

Browse files
Backport #83891 to 25.7: Fix 02233_HTTP_ranged
1 parent 94e4b63 commit 81fcb0d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/queries/0_stateless/02233_HTTP_ranged.python

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ EXPECTED_ANSWER = """{\\n\\t"login": "ClickHouse",\\n\\t"id": 54801242,\\n\\t"na
5555
#####################################################################################
5656

5757
# IP-address of this host accessible from the outside world. Get the first one
58-
HTTP_SERVER_HOST = (
59-
subprocess.check_output(["hostname", "-i"]).decode("utf-8").strip().split()[0]
60-
)
58+
try:
59+
HTTP_SERVER_HOST = (
60+
subprocess.check_output(["hostname", "-i"]).decode("utf-8").strip().split()[0]
61+
)
62+
except:
63+
HTTP_SERVER_HOST = "127.0.0.1"
6164
IS_IPV6 = is_ipv6(HTTP_SERVER_HOST)
6265
HTTP_SERVER_PORT = get_local_port(HTTP_SERVER_HOST, IS_IPV6)
6366

@@ -275,15 +278,16 @@ def run_test(allow_range, settings, check_retries=False):
275278
def main():
276279
t, httpd = start_server()
277280

278-
settings = {"max_download_buffer_size": 20}
281+
settings = {"max_threads": 1}
282+
settings["max_download_buffer_size"] = 20
279283

280284
# Test Accept-Ranges=False
281285
run_test(allow_range=False, settings=settings)
282286
# Test Accept-Ranges=True, parallel download is used
283287
run_test(allow_range=True, settings=settings)
284288

285289
# Test Accept-Ranges=True, parallel download is used
286-
settings = {"max_download_buffer_size": 10}
290+
settings["max_download_buffer_size"] = 10
287291
run_test(allow_range=True, settings=settings)
288292

289293
# Test Accept-Ranges=True, parallel download is not used,

0 commit comments

Comments
 (0)