提交 0cb66695 编写于 作者: A Azat Khuzhin

Add integration test for input_format_parallel_parsing memory tracking

上级 303635a5
<yandex>
<!-- make it fail earlier -->
<max_server_memory_usage>3000000000</max_server_memory_usage> <!-- 3GB -->
</yandex>
# pylint: disable=unused-argument
# pylint: disable=redefined-outer-name
# pylint: disable=line-too-long
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
instance = cluster.add_instance('instance', main_configs=['configs/conf.xml'])
@pytest.fixture(scope='module', autouse=True)
def start_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
# max_memory_usage_for_user cannot be used, since the memory for user accounted
# correctly, only total is not
def test_memory_tracking_total():
instance.query('''
CREATE TABLE null (row String) ENGINE=Null;
''')
instance.exec_in_container(['bash', '-c',
'clickhouse client -q "SELECT arrayStringConcat(arrayMap(x->toString(cityHash64(x)), range(1000)), \' \') from numbers(10000)" > data.json'])
for it in range(0, 20):
# the problem can be triggered only via HTTP,
# since clickhouse-client parses the data by itself.
assert instance.exec_in_container(['curl', '--silent', '--show-error', '--data-binary', '@data.json',
'http://127.1:8123/?query=INSERT%20INTO%20null%20FORMAT%20TSV']) == '', 'Failed on {} iteration'.format(it)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册