From 5438140e33532267b50dd98b6482ae40c05ed51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 18 Jun 2018 00:16:28 +0300 Subject: [PATCH] Wait for monitor in mxs1476 Use Maxscales::wait_for_monitor instead of hard-coded sleeps. This should make testing faster, more accurate as well as more robust. --- maxscale-system-test/mxs1476.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maxscale-system-test/mxs1476.cpp b/maxscale-system-test/mxs1476.cpp index 56c3719ba..e5326c0b5 100644 --- a/maxscale-system-test/mxs1476.cpp +++ b/maxscale-system-test/mxs1476.cpp @@ -23,14 +23,14 @@ void do_test(TestConnections& test, int master, int slave) test.tprintf("Stop a slave node and perform an insert"); test.galera->block_node(slave); - sleep(10); + test.maxscales->wait_for_monitor(); list_servers(test); test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)"); test.tprintf("Start the slave node and perform another insert"); test.galera->unblock_node(slave); - sleep(10); + test.maxscales->wait_for_monitor(); list_servers(test); test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)"); @@ -38,7 +38,7 @@ void do_test(TestConnections& test, int master, int slave) test.tprintf("Stop the master node and perform an insert"); test.galera->block_node(master); - sleep(10); + test.maxscales->wait_for_monitor(); list_servers(test); test.maxscales->connect_maxscale(0); @@ -46,7 +46,7 @@ void do_test(TestConnections& test, int master, int slave) test.tprintf("Start the master node and perform another insert (expecting failure)"); test.galera->unblock_node(master); - sleep(10); + test.maxscales->wait_for_monitor(); list_servers(test); test.add_result(execute_query_silent(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)") == 0,