Fix failing tests

Changed mxs1719 to expect a failure with the query and added monitor waits
to mxs359_read_only.
This commit is contained in:
Markus Mäkelä 2018-07-06 17:14:22 +03:00
parent 40d076b4ce
commit 8470da9313
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 11 additions and 8 deletions

View File

@ -42,8 +42,10 @@ void run(TestConnections& test)
if (mysql_real_connect(pMysql, test.maxscales->IP[0], zUser, zPassword, "test", port, NULL,
CLIENT_MULTI_STATEMENTS))
{
// One multi-statement with two UPDATEs.
test.try_query(pMysql, "UPDATE MXS_1719 SET a=1; UPDATE MXS_1719 SET a=1;");
const char* q = "UPDATE MXS_1719 SET a=1; UPDATE MXS_1719 SET a=1;";
// One multi-statement with two UPDATEs. Note: This query should fail
// with 2.3 now that function blocking has been added
test.assert(execute_query_silent(pMysql, q) != 0, "Query '%s' should not succeed", q);
// Sleep a while, so that the log is flushed.
sleep(5);
@ -54,6 +56,7 @@ void run(TestConnections& test)
// This will hang immediately, so we can shorten the timeout.
test.set_timeout(5);
test.try_query(pMysql, "SELECT * FROM MXS_1719");
test.stop_timeout();
}
else
{

View File

@ -37,14 +37,14 @@ void test_replaced_master(TestConnections& test, std::ostream& out)
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1");
test.repl->block_node(0);
sleep(10);
test.maxscales->wait_for_monitor();
out << "Reads should still work even if no master is available" << endl;
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1");
test.repl->unblock_node(0);
change_master(1, 0);
sleep(10);
test.maxscales->wait_for_monitor();
out << "Reads and writes after master change should work" << endl;
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (2)");
@ -58,14 +58,14 @@ void test_new_master(TestConnections& test, std::ostream& out)
{
out << "Block the master before connecting" << endl;
test.repl->block_node(0);
sleep(10);
test.maxscales->wait_for_monitor();
out << "Connect and check that read-only mode works" << endl;
test.maxscales->connect();
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1");
change_master(1, 0);
sleep(10);
test.maxscales->wait_for_monitor();
out << "Both reads and writes after master change should work" << endl;
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (2)");
@ -84,7 +84,7 @@ void test_master_failure(TestConnections& test, std::ostream& out)
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1");
test.repl->block_node(0);
sleep(10);
test.maxscales->wait_for_monitor();
out << "Reads should still work even if no master is available" << endl;
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1");
@ -122,7 +122,7 @@ int main(int argc, char** argv)
i.func(test, out);
if (test.global_result)
{
test.tprintf("Test '%s' failed: %s", i.description, out.str().c_str());
test.tprintf("Test '%s' failed: \n\n%s\n\n", i.description, out.str().c_str());
break;
}
}