From 3ca32457db549a22e50e8718616b034b142dc50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 19 Dec 2017 09:23:44 +0200 Subject: [PATCH] Don't force verbose output The tests shouldn't force verbose output. --- maxscale-system-test/mariadb_nodes.cpp | 27 +++++++++++++++----------- maxscale-system-test/mariadb_nodes.h | 1 + 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index e701716cc..9ee264d14 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -708,13 +708,13 @@ bool Mariadb_nodes::check_master_node(MYSQL *conn) } /** - * @brief bad_slave_thread_status Check if filed in the slave status outpur is not 'yes' + * @brief bad_slave_thread_status Check if field in the slave status outpur is not 'yes' * @param conn MYSQL struct (connection have to be open) - * @param field Filed to check + * @param field Field to check * @param node Node index - * @return false if requested filed is 'Yes' + * @return false if requested field is 'Yes' */ -static bool bad_slave_thread_status(MYSQL *conn, const char *field, int node) +bool Mariadb_nodes::bad_slave_thread_status(MYSQL *conn, const char *field, int node) { char str[1024] = ""; bool rval = false; @@ -725,23 +725,29 @@ static bool bad_slave_thread_status(MYSQL *conn, const char *field, int node) if (find_field(conn, "SHOW SLAVE STATUS;", field, str) != 0) { printf("Node %d: %s not found in SHOW SLAVE STATUS\n", node, field); - fflush(stdout); break; } - else if (strcmp(str, "Yes") == 0 || strcmp(str, "No") == 0) + + if (verbose) + { + printf("Node %d: field %s is %s\n", node, field, str); + } + + if (strcmp(str, "Yes") == 0 || strcmp(str, "No") == 0) { - printf("Node %d: filed %s is %s\n", node, field, str); break; } - printf("Node %d: filed %s is %s\n", node, field, str); + /** Any other state is transient and we should try again */ sleep(1); } if (strcmp(str, "Yes") != 0) { - printf("Node %d: %s is '%s'\n", node, field, str); - fflush(stdout); + if (verbose) + { + printf("Node %d: %s is '%s'\n", node, field, str); + } rval = true; } @@ -835,7 +841,6 @@ int Mariadb_nodes::check_replication() bool Mariadb_nodes::fix_replication() { - verbose = true; if (check_replication()) { unblock_all_nodes(); diff --git a/maxscale-system-test/mariadb_nodes.h b/maxscale-system-test/mariadb_nodes.h index 79ff180e2..88da075ac 100644 --- a/maxscale-system-test/mariadb_nodes.h +++ b/maxscale-system-test/mariadb_nodes.h @@ -480,6 +480,7 @@ private: int check_node_ssh(int node); bool check_master_node(MYSQL *conn); + bool bad_slave_thread_status(MYSQL *conn, const char *field, int node); }; class Galera_nodes : public Mariadb_nodes