fix CI timeout err

This commit is contained in:
taichong 2020-11-27 09:03:21 +08:00
parent b5440882cd
commit c8f7a56a25
6 changed files with 17 additions and 7 deletions

View File

@ -2,7 +2,7 @@ version: '2.3'
services:
mysql1:
image: mysql:5.7
restart: 'no'
restart: always
environment:
MYSQL_ROOT_PASSWORD: clickhouse
ports:

View File

@ -0,0 +1,10 @@
version: '2.3'
services:
mysql1:
image: mysql:5.7
restart: 'no'
environment:
MYSQL_ROOT_PASSWORD: clickhouse
ports:
- 3308:3306
command: --server_id=100 --log-bin='mysql-bin-1.log' --default-time-zone='+3:00' --gtid-mode="ON" --enforce-gtid-consistency

View File

@ -436,10 +436,9 @@ class ClickHouseCluster:
while time.time() - start < timeout:
try:
conn = pymysql.connect(user='root', password='clickhouse', host='127.0.0.1', port=3308)
if conn.ping():
conn.close()
print("Mysql Started")
return
conn.close()
print("Mysql Started")
return
except Exception as ex:
print("Can't connect to MySQL " + str(ex))
time.sleep(0.5)

View File

@ -584,6 +584,7 @@ def network_partition_test(clickhouse_node, mysql_node, service_name):
clickhouse_node.query(
"CREATE DATABASE test_database ENGINE = MaterializeMySQL('{}:3306', 'test_database', 'root', 'clickhouse')".format(service_name))
check_query(clickhouse_node, "SELECT * FROM test_database.test_table", '')
with PartitionManager() as pm:
drop_instance_mysql_connections(clickhouse_node, pm)

View File

@ -89,7 +89,7 @@ class MySQLNodeInstance:
@pytest.fixture(scope="module")
def started_mysql_5_7():
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_mysql.yml')
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_mysql_5_7_for_materialize_mysql.yml')
mysql_node = MySQLNodeInstance('root', 'clickhouse', '127.0.0.1', 3308, docker_compose)
try:
@ -105,7 +105,7 @@ def started_mysql_5_7():
@pytest.fixture(scope="module")
def started_mysql_8_0():
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_mysql_8_0.yml')
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_mysql_8_0_for_materialize_mysql.yml')
mysql_node = MySQLNodeInstance('root', 'clickhouse', '127.0.0.1', 33308, docker_compose)
try: