Wait for a number of monitor intervals in tests

The tests can now wait for a number of monitor intervals. This removes the
need to have hard-coded sleeps in the code and makes monitor tests more
robust under heavier load.
This commit is contained in:
Markus Mäkelä
2018-06-05 22:06:33 +03:00
parent 7be11af911
commit d0feff5eb3
23 changed files with 152 additions and 86 deletions

View File

@ -33,7 +33,7 @@ int main(int argc, char *argv[])
execute_query(test->repl->nodes[3], "STOP SLAVE;RESET SLAVE ALL;");
test->tprintf("Wait for the monitor to detect it ");
sleep(15);
test.maxscales->wait_for_monitor();
test->tprintf("Connect and insert should work ");
char *output = test->ssh_maxscale_output(true, "maxadmin list servers");
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
test->repl->unblock_node(2);
test->tprintf("Wait for the monitor to detect it ");
sleep(15);
test.maxscales->wait_for_monitor();
test->tprintf("Check that we are still using the last node to which we failed over "
"to and that the old nodes are in maintenance mode");