Repository navigation
Fix flaky test 01600_benchmark_query - #108570
alexey-milovidov merged 2 commits into
Conversation
clickhouse-benchmark sets the socket receive timeout for the handshake read to handshake_timeout_ms (default 10s). On the slowest CI lanes (amd_msan + WasmEdge under parallel load) the server can take longer than 10s to send the Hello packet, so receiveHello() throws a SOCKET_TIMEOUT NetException. That text leaks into the captured stderr and trips the test's `grep Exception`, producing extra output that no longer matches the .reference file. Give the connect and handshake a generous budget (60s) so a slow but healthy server completes the handshake. The test still verifies that the benchmark loads and runs the query without any spurious exception. Same class of fix as 03636_benchmark_error_messages and 02550_benchmark_connections_credentials (PR ClickHouse#103298). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260626-044400 |
|
Workflow [PR], commit [c45eed0] Summary: ✅ AI ReviewSummaryThis PR raises the Final VerdictStatus: ✅ Approve |
CI finish ledger — 7ec04d1Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
This PR is a one-line test fix to Session id: cron:our-pr-ci-monitor:20260626-170000 |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 305 line(s), 50 function(s) across 125 file(s) · Details Top files
|
clickhouse-benchmark uses the default handshake_timeout_ms=10000 (10s) and connect_timeout=10s. On slow lanes (amd_tsan, s3 storage, parallel) the TLS handshake to the secure port can take longer than 10s under load, so the client aborts with Code: 209 DB::NetException Timeout exceeded (SOCKET_TIMEOUT) before certificate verification runs. That breaks both checks: the first invocation loses its expected "certificate verify failed" line, and the SOCKET_TIMEOUT text trips grep Exception in the second invocation. "Server died" is the harness verdict from the same slow-response window, not a crash. Add --connect_timeout 60 --handshake_timeout_ms 60000 to the benchmark invocations so the handshake has a generous budget on slow lanes. The test still verifies the same behavior: --secure without --accept-invalid-certificate still prints "certificate verify failed", and --secure --accept-invalid-certificate still succeeds with no exception. Same approach as 01600_benchmark_query (ClickHouse#108570) and 03636_benchmark_error_messages (ClickHouse#103298, ClickHouse#103668). Reported on ClickHouse#100332 by alexey-milovidov. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The test asserts that a clickhouse-benchmark run logs 3 queries under one initial_query_id. On a loaded runner it read 0 instead of 3. The benchmark process never ran its query. Connection::connect uses handshake_timeout_ms (default 10000, Settings.cpp:410) as the socket receive timeout for the server Hello read, and clickhouse-test gives the benchmark no timeout overrides (shell_config.sh builds CLICKHOUSE_BENCHMARK_OPT0 from only --port, --database and --log_comment, while the client gets connect_timeout and receive_timeout from the runner). When the accept/handshake path stalls for longer than 10 s the benchmark exits with SOCKET_TIMEOUT before sending any query, so query_log has no rows for that query_id and the assertion reads 0. In the reported run the server accepted no TCP connection for 22.50 s (21:45:14.247 to 21:45:36.747 in the job's clickhouse-server.log, zero TCPHandlerFactory accepts in between, and executeQuery starts fell to 0 for the 11 s from 21:45:17 to 21:45:27). The benchmark's connection was accepted at the end of that window and the server logged "Client has gone away", the benchmark having already given up. The job's query_log.tsv confirms it: the failing instance has 0 rows with client_name = 'ClickHouse benchmark', while each of the 6 in-place reruns has exactly 3. Give connect and handshake a generous budget, matching the same fix already merged for 01600_benchmark_query (ClickHouse#108570) and present in 03630_benchmark_accept_invalid_certificate and 03636_benchmark_error_messages. The assertion is unchanged, so what the test verifies is unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
The test asserts that a clickhouse-benchmark run logs 3 queries under one initial_query_id. On a loaded runner it read 0 instead of 3. The benchmark process never ran its query. Connection::connect uses handshake_timeout_ms (default 10000, Settings.cpp:410) as the socket receive timeout for the server Hello read, and clickhouse-test gives the benchmark no timeout overrides (shell_config.sh builds CLICKHOUSE_BENCHMARK_OPT0 from only --port, --database and --log_comment, while the client gets connect_timeout and receive_timeout from the runner). When the accept/handshake path stalls for longer than 10 s the benchmark exits with SOCKET_TIMEOUT before sending any query, so query_log has no rows for that query_id and the assertion reads 0. In the reported run the server accepted no TCP connection for 22.50 s (21:45:14.247 to 21:45:36.747 in the job's clickhouse-server.log, zero TCPHandlerFactory accepts in between, and executeQuery starts fell to 0 for the 11 s from 21:45:17 to 21:45:27). The benchmark's connection was accepted at the end of that window and the server logged "Client has gone away", the benchmark having already given up. The job's query_log.tsv confirms it: the failing instance has 0 rows with client_name = 'ClickHouse benchmark', while each of the 6 in-place reruns has exactly 3. Give connect and handshake a generous budget, matching the same fix already merged for 01600_benchmark_query (ClickHouse#108570) and present in 03630_benchmark_accept_invalid_certificate and 03636_benchmark_error_messages. The assertion is unchanged, so what the test verifies is unchanged. Co-Authored-By: Claude Fable 5 <[email protected]> (cherry picked from commit 7199612)
…nchmark-query-handshake-timeout Fix flaky test 01600_benchmark_query
clickhouse-benchmark uses the default handshake_timeout_ms=10000 (10s) and connect_timeout=10s. On slow lanes (amd_tsan, s3 storage, parallel) the TLS handshake to the secure port can take longer than 10s under load, so the client aborts with Code: 209 DB::NetException Timeout exceeded (SOCKET_TIMEOUT) before certificate verification runs. That breaks both checks: the first invocation loses its expected "certificate verify failed" line, and the SOCKET_TIMEOUT text trips grep Exception in the second invocation. "Server died" is the harness verdict from the same slow-response window, not a crash. Add --connect_timeout 60 --handshake_timeout_ms 60000 to the benchmark invocations so the handshake has a generous budget on slow lanes. The test still verifies the same behavior: --secure without --accept-invalid-certificate still prints "certificate verify failed", and --secure --accept-invalid-certificate still succeeds with no exception. Same approach as 01600_benchmark_query (ClickHouse#108570) and 03636_benchmark_error_messages (ClickHouse#103298, ClickHouse#103668). Reported on ClickHouse#100332 by alexey-milovidov. Co-Authored-By: Claude Opus 4.8 <[email protected]>
No related open issue found (failure is a transient flaky surfaced on a single PR run).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
01600_benchmark_queryrunsclickhouse-benchmark --iterations 10 --query "SELECT 1", captures stderr, and asserts (viagrep Exception/grep Loaded) that no exception was raised and the query loaded.clickhouse-benchmark sets the socket receive timeout for the handshake read to
handshake_timeout_ms(default 10s) inConnection::connect()beforereceiveHello(). On the slowest CI lane (Stateless tests (amd_msan, WasmEdge, parallel), MSAN shadow memory + WasmEdge interpreter, under parallel load) the server can take longer than 10s to send the Hello packet, soreceiveHello()throwsCode: 209. DB::NetException: Timeout exceeded while reading from socket (... 10000 ms): (SOCKET_TIMEOUT). That text leaks into the captured stderr and tripsgrep Exception, so stdout no longer matches the.referencefile and the test FAILs.Fix: give connect and handshake a generous budget (
--connect_timeout 60 --handshake_timeout_ms 60000) so a slow but healthy server completes the handshake. The test still verifies the benchmark loads and runs the query without any spurious exception. Same class of fix as03636_benchmark_error_messagesand02550_benchmark_connections_credentials(#103298).