Merge pull request #29600 from ClickHouse/skip-executable-table-function-test-msan

Skip test for executable table function under MSan
This commit is contained in:
Maksim Kita 2021-10-01 12:09:14 +03:00 committed by GitHub
commit 3d3f0d3548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,12 @@ cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', stay_alive=True, main_configs=[])
# Something like https://reviews.llvm.org/D33325
def skip_test_msan(instance):
if instance.is_built_with_memory_sanitizer():
pytest.skip("Memory Sanitizer cannot work with vfork")
def copy_file_to_container(local_path, dist_path, container_id):
os.system("docker cp {local} {cont_id}:{dist}".format(local=local_path, cont_id=container_id, dist=dist_path))
@ -30,32 +36,39 @@ def started_cluster():
cluster.shutdown()
def test_executable_function_no_input(started_cluster):
skip_test_msan(node)
assert node.query("SELECT * FROM executable('test_no_input.sh', 'TabSeparated', 'value UInt64')") == '1\n'
def test_executable_function_input(started_cluster):
skip_test_msan(node)
assert node.query("SELECT * FROM executable('test_input.sh', 'TabSeparated', 'value String', (SELECT 1))") == 'Key 1\n'
def test_executable_function_input_multiple_pipes(started_cluster):
skip_test_msan(node)
actual = node.query("SELECT * FROM executable('test_input_multiple_pipes.sh', 'TabSeparated', 'value String', (SELECT 1), (SELECT 2), (SELECT 3))")
expected = 'Key from 4 fd 3\nKey from 3 fd 2\nKey from 0 fd 1\n'
assert actual == expected
def test_executable_function_argument(started_cluster):
skip_test_msan(node)
assert node.query("SELECT * FROM executable('test_argument.sh 1', 'TabSeparated', 'value String')") == 'Key 1\n'
def test_executable_storage_no_input(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value UInt64) ENGINE=Executable('test_no_input.sh', 'TabSeparated')")
assert node.query("SELECT * FROM test_table") == '1\n'
node.query("DROP TABLE test_table")
def test_executable_storage_input(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value String) ENGINE=Executable('test_no_input.sh', 'TabSeparated', (SELECT 1))")
assert node.query("SELECT * FROM test_table") == '1\n'
node.query("DROP TABLE test_table")
def test_executable_storage_input_multiple_pipes(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value String) ENGINE=Executable('test_input_multiple_pipes.sh', 'TabSeparated', (SELECT 1), (SELECT 2), (SELECT 3))")
actual = node.query("SELECT * FROM test_table")
@ -64,18 +77,21 @@ def test_executable_storage_input_multiple_pipes(started_cluster):
node.query("DROP TABLE test_table")
def test_executable_storage_argument(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value String) ENGINE=Executable('test_argument.sh 1', 'TabSeparated')")
assert node.query("SELECT * FROM test_table") == 'Key 1\n'
node.query("DROP TABLE test_table")
def test_executable_pool_storage(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value String) ENGINE=ExecutablePool('test_input_process_pool.sh', 'TabSeparated', (SELECT 1))")
assert node.query("SELECT * FROM test_table") == 'Key 1\n'
node.query("DROP TABLE test_table")
def test_executable_pool_storage_multiple_pipes(started_cluster):
skip_test_msan(node)
node.query("DROP TABLE IF EXISTS test_table")
node.query("CREATE TABLE test_table (value String) ENGINE=ExecutablePool('test_input_process_pool_multiple_pipes.sh', 'TabSeparated', (SELECT 1), (SELECT 2), (SELECT 3))")
assert node.query("SELECT * FROM test_table") == 'Key from 4 fd 3\nKey from 3 fd 2\nKey from 0 fd 1\n'