mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Add test.
This commit is contained in:
parent
adc103e338
commit
0c23d44b99
@ -224,6 +224,7 @@ class IColumn;
|
|||||||
/** Settings for testing hedged requests */ \
|
/** Settings for testing hedged requests */ \
|
||||||
M(Milliseconds, sleep_in_send_tables_status_ms, 0, "Time to sleep in sending tables status response in TCPHandler", 0) \
|
M(Milliseconds, sleep_in_send_tables_status_ms, 0, "Time to sleep in sending tables status response in TCPHandler", 0) \
|
||||||
M(Milliseconds, sleep_in_send_data_ms, 0, "Time to sleep in sending data in TCPHandler", 0) \
|
M(Milliseconds, sleep_in_send_data_ms, 0, "Time to sleep in sending data in TCPHandler", 0) \
|
||||||
|
M(UInt64, unknown_packet_in_send_data, 0, "Send unknown packet instead of data Nth data packet", 0) \
|
||||||
\
|
\
|
||||||
M(Bool, insert_allow_materialized_columns, 0, "If setting is enabled, Allow materialized columns in INSERT.", 0) \
|
M(Bool, insert_allow_materialized_columns, 0, "If setting is enabled, Allow materialized columns in INSERT.", 0) \
|
||||||
M(Seconds, http_connection_timeout, DEFAULT_HTTP_READ_BUFFER_CONNECTION_TIMEOUT, "HTTP connection timeout.", 0) \
|
M(Seconds, http_connection_timeout, DEFAULT_HTTP_READ_BUFFER_CONNECTION_TIMEOUT, "HTTP connection timeout.", 0) \
|
||||||
|
@ -1463,12 +1463,20 @@ void TCPHandler::sendData(const Block & block)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
/// For testing hedged requests
|
||||||
|
const Settings & settings = query_context->getSettingsRef();
|
||||||
|
if (settings.unknown_packet_in_send_data)
|
||||||
|
{
|
||||||
|
--const_cast<SettingFieldUInt64 &>(settings.unknown_packet_in_send_data).value;
|
||||||
|
if (settings.unknown_packet_in_send_data == 0)
|
||||||
|
writeVarUInt(UInt64(-1), *out);
|
||||||
|
}
|
||||||
|
|
||||||
writeVarUInt(Protocol::Server::Data, *out);
|
writeVarUInt(Protocol::Server::Data, *out);
|
||||||
/// Send external table name (empty name is the main table)
|
/// Send external table name (empty name is the main table)
|
||||||
writeStringBinary("", *out);
|
writeStringBinary("", *out);
|
||||||
|
|
||||||
/// For testing hedged requests
|
/// For testing hedged requests
|
||||||
const Settings & settings = query_context->getSettingsRef();
|
|
||||||
if (block.rows() > 0 && settings.sleep_in_send_data_ms.totalMilliseconds())
|
if (block.rows() > 0 && settings.sleep_in_send_data_ms.totalMilliseconds())
|
||||||
{
|
{
|
||||||
out->next();
|
out->next();
|
||||||
|
9
tests/queries/0_stateless/01822_async_read_from_socket_crash.sh
Executable file
9
tests/queries/0_stateless/01822_async_read_from_socket_crash.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for _ in {1..10}; do $CLICKHOUSE_CLIENT -q "select number from remote('127.0.0.{2,3}', numbers(20)) limit 8 settings max_block_size = 2, unknown_packet_in_send_data=4, sleep_in_send_data_ms=100, async_socket_for_remote=1 format Null" 2>&1 > /dev/null; done
|
Loading…
Reference in New Issue
Block a user