From a33f09ad064dbacaaf449e019cb3b173b890bc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 21 May 2018 18:18:50 +0300 Subject: [PATCH] Fix test failures and add debug logging Fixed test failures, increased some of the timeouts, added extra info level logging into rwsplit to help debug the test failures. --- maxscale-system-test/mxs682_cyrillic.cpp | 33 +++---------------- maxscale-system-test/show_monitor_crash.cpp | 3 +- .../readwritesplit/rwsplit_route_stmt.cc | 1 + .../routing/readwritesplit/rwsplitsession.cc | 1 + 4 files changed, 9 insertions(+), 29 deletions(-) diff --git a/maxscale-system-test/mxs682_cyrillic.cpp b/maxscale-system-test/mxs682_cyrillic.cpp index 7189cde5e..f0ae95c33 100644 --- a/maxscale-system-test/mxs682_cyrillic.cpp +++ b/maxscale-system-test/mxs682_cyrillic.cpp @@ -4,8 +4,6 @@ * - check SELECT from backend */ - - #include #include #include "testconnections.h" @@ -30,7 +28,7 @@ void check_val(MYSQL* conn, TestConnections* Test) int main(int argc, char *argv[]) { TestConnections * Test = new TestConnections(argc, argv); - Test->set_timeout(10); + Test->set_timeout(30); Mariadb_nodes * nodes; if (strstr(Test->test_name, "galera") != NULL) @@ -43,34 +41,13 @@ int main(int argc, char *argv[]) nodes = Test->repl; } - - /* - iconv_t converter = iconv_open ("koi8-r", "utf-8"); - Test->tprintf("errno %d\n", errno); - - char in_buf[] = "Кот"; - char out_buf[100]; - char *in_ptr = in_buf; - char *out_ptr = out_buf; - size_t in_size = strlen(in_buf); - size_t out_size = 100; - - size_t n = iconv(converter, &in_ptr, &in_size, &out_ptr, &out_size); - - Test->tprintf("n = %d\n", n); - //Test->tprintf("UTF-8: %s\n", out_buf); - - iconv_close(converter); - */ - Test->maxscales->connect_maxscale(0); - Test->set_timeout(10); + Test->set_timeout(30); nodes->connect(); - Test->set_timeout(10); + Test->set_timeout(30); MYSQL * conn = Test->maxscales->conn_rwsplit[0]; - //Test->try_query(conn, (char *) "set names utf8mb4;"); execute_query_silent(conn, (char *) "DROP TABLE t2;"); Test->try_query(conn, (char *) "CREATE TABLE t2 (x varchar(10));"); char sql[256]; @@ -79,6 +56,7 @@ int main(int argc, char *argv[]) Test->stop_timeout(); sleep(5); + Test->set_timeout(30); check_val(Test->maxscales->conn_rwsplit[0], Test); check_val(Test->maxscales->conn_master[0], Test); check_val(Test->maxscales->conn_slave[0], Test); @@ -88,8 +66,7 @@ int main(int argc, char *argv[]) Test->tprintf("Node %d\n", i); check_val(nodes->nodes[i], Test); } - - //execute_query_silent(conn, (char *) "DROP TABLE t2;"); + Test->stop_timeout(); Test->check_maxscale_alive(0); int rval = Test->global_result; diff --git a/maxscale-system-test/show_monitor_crash.cpp b/maxscale-system-test/show_monitor_crash.cpp index fd51fcefd..8bfd0d864 100644 --- a/maxscale-system-test/show_monitor_crash.cpp +++ b/maxscale-system-test/show_monitor_crash.cpp @@ -20,7 +20,8 @@ int main(int argc, char *argv[]) Test->set_timeout(100); Test->maxscales->execute_maxadmin_command(0, (char *) "show monitors"); sleep(5); - Test->check_log_err(0, (char *) "Failed to start monitor", true); + // Servers should get the Auth Error state when credentials are bad + Test->check_log_err(0, (char *) "Auth Error, Down", true); Test->check_log_err(0, (char *) "fatal signal 11", false); Test->check_maxscale_processes(0, 1); diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index 85f4bfb3f..348a73b92 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -228,6 +228,7 @@ bool RWSplitSession::route_single_stmt(GWBUF *querybuf) // We need to wait until the session commands are executed m_expected_responses++; m_query_queue = gwbuf_append(m_query_queue, gwbuf_clone(querybuf)); + MXS_INFO("Queuing query until '%s' completes session command", target->name()); } else { diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index 39b93a665..5871825e9 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -199,6 +199,7 @@ bool RWSplitSession::route_stored_query() * to wait for a response before attempting another reroute */ while (m_query_queue) { + MXS_INFO("Routing stored queries"); GWBUF* query_queue = modutil_get_next_MySQL_packet(&m_query_queue); query_queue = gwbuf_make_contiguous(query_queue);