Skip to content

Commit 907578f

Browse files
committed
Cat mysql log in case we fail to start mysql service.
1 parent 346cdd3 commit 907578f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/smoke_tests/monitors_test/mysql_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ def mysql_client():
4848
# see: https://serverfault.com/a/872576
4949
os.system("chown -R mysql:mysql /var/lib/mysql /var/run/mysqld")
5050

51-
os.system("service mysql start")
51+
exit_code = os.system("service mysql start")
52+
53+
# On failure include service logs for ease of debugging
54+
if exit_code != 0:
55+
os.system("cat /var/log/mysql/mysql.log || true")
5256

5357
os.system("mysql < /init.sql")
5458

0 commit comments

Comments
 (0)