Disable MySQL tests under tsan

This commit is contained in:
alesapin 2020-06-22 16:10:25 +03:00
parent d6abf45a2d
commit 588568f39c
2 changed files with 47 additions and 1 deletions

View File

@ -732,6 +732,10 @@ class ClickHouseInstance:
self.ipv6_address = ipv6_address self.ipv6_address = ipv6_address
self.with_installed_binary = with_installed_binary self.with_installed_binary = with_installed_binary
def is_built_with_thread_sanitizer(self):
build_opts = self.query("SELECT value FROM system.build_options WHERE name = 'CXX_FLAGS'")
return "-fsanitize=thread" in build_opts
# Connects to the instance via clickhouse-client, sends a query (1st argument) and returns the answer # Connects to the instance via clickhouse-client, sends a query (1st argument) and returns the answer
def query(self, sql, stdin=None, timeout=None, settings=None, user=None, password=None, ignore_error=False): def query(self, sql, stdin=None, timeout=None, settings=None, user=None, password=None, ignore_error=False):
return self.client.query(sql, stdin, timeout, settings, user, password, ignore_error) return self.client.query(sql, stdin, timeout, settings, user, password, ignore_error)

View File

@ -153,6 +153,7 @@ def get_dict(source, layout, fields, suffix_name=''):
dictionary.generate_config() dictionary.generate_config()
return dictionary return dictionary
def setup_module(module): def setup_module(module):
global DICTIONARIES global DICTIONARIES
global cluster global cluster
@ -210,8 +211,42 @@ def get_dictionaries(fold, total_folds, all_dicts):
return all_dicts[fold * chunk_len : (fold + 1) * chunk_len] return all_dicts[fold * chunk_len : (fold + 1) * chunk_len]
def remove_mysql_dicts():
"""
We have false-positive race condition in our openSSL version.
MySQL dictionary use OpenSSL, so to prevent known failure we
disable tests for these dictionaries.
Read of size 8 at 0x7b3c00005dd0 by thread T61 (mutexes: write M1010349240585225536):
#0 EVP_CIPHER_mode <null> (clickhouse+0x13b2223b)
#1 do_ssl3_write <null> (clickhouse+0x13a137bc)
#2 ssl3_write_bytes <null> (clickhouse+0x13a12387)
#3 ssl3_write <null> (clickhouse+0x139db0e6)
#4 ssl_write_internal <null> (clickhouse+0x139eddce)
#5 SSL_write <null> (clickhouse+0x139edf20)
#6 ma_tls_write <null> (clickhouse+0x139c7557)
#7 ma_pvio_tls_write <null> (clickhouse+0x139a8f59)
#8 ma_pvio_write <null> (clickhouse+0x139a8488)
#9 ma_net_real_write <null> (clickhouse+0x139a4e2c)
#10 ma_net_write_command <null> (clickhouse+0x139a546d)
#11 mthd_my_send_cmd <null> (clickhouse+0x13992546)
#12 mysql_close_slow_part <null> (clickhouse+0x13999afd)
#13 mysql_close <null> (clickhouse+0x13999071)
#14 mysqlxx::Connection::~Connection() <null> (clickhouse+0x1370f814)
#15 mysqlxx::Pool::~Pool() <null> (clickhouse+0x13715a7b)
TODO remove this when open ssl will be fixed or thread sanitizer will be suppressed
"""
global DICTIONARIES
DICTIONARIES = [d for d in DICTIONARIES if not d.name.startswith("MySQL")]
@pytest.mark.parametrize("fold", list(range(10))) @pytest.mark.parametrize("fold", list(range(10)))
def test_simple_dictionaries(started_cluster, fold): def test_simple_dictionaries(started_cluster, fold):
if node.is_built_with_thread_sanitizer():
remove_mysql_dicts()
fields = FIELDS["simple"] fields = FIELDS["simple"]
values = VALUES["simple"] values = VALUES["simple"]
data = [Row(fields, vals) for vals in values] data = [Row(fields, vals) for vals in values]
@ -259,6 +294,10 @@ def test_simple_dictionaries(started_cluster, fold):
@pytest.mark.parametrize("fold", list(range(10))) @pytest.mark.parametrize("fold", list(range(10)))
def test_complex_dictionaries(started_cluster, fold): def test_complex_dictionaries(started_cluster, fold):
if node.is_built_with_thread_sanitizer():
remove_mysql_dicts()
fields = FIELDS["complex"] fields = FIELDS["complex"]
values = VALUES["complex"] values = VALUES["complex"]
data = [Row(fields, vals) for vals in values] data = [Row(fields, vals) for vals in values]
@ -292,6 +331,9 @@ def test_complex_dictionaries(started_cluster, fold):
@pytest.mark.parametrize("fold", list(range(10))) @pytest.mark.parametrize("fold", list(range(10)))
def test_ranged_dictionaries(started_cluster, fold): def test_ranged_dictionaries(started_cluster, fold):
if node.is_built_with_thread_sanitizer():
remove_mysql_dicts()
fields = FIELDS["ranged"] fields = FIELDS["ranged"]
values = VALUES["ranged"] values = VALUES["ranged"]
data = [Row(fields, vals) for vals in values] data = [Row(fields, vals) for vals in values]
@ -380,7 +422,7 @@ def test_key_value_complex_dictionaries(started_cluster, fold):
values = VALUES["complex"] values = VALUES["complex"]
data = [Row(fields, vals) for vals in values] data = [Row(fields, vals) for vals in values]
all_complex_dicts = [d for d in DICTIONARIES if d.structure.layout.layout_type == "complex"] all_complex_dicts = [d for d in DICTIONARIES_KV if d.structure.layout.layout_type == "complex"]
complex_dicts = get_dictionaries(fold, 10, all_complex_dicts) complex_dicts = get_dictionaries(fold, 10, all_complex_dicts)
for dct in complex_dicts: for dct in complex_dicts:
dct.load_data(data) dct.load_data(data)