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

@ -21,13 +21,13 @@ int main(int argc, char** argv)
test.repl->connect();
delete_slave_binlogs(test);
sleep(2);
test.maxscales->wait_for_monitor();
basic_test(test);
print_gtids(test);
// Part 1
int node0_id = prepare_test_1(test);
sleep(10);
test.maxscales->wait_for_monitor();
check_test_1(test, node0_id);
if (test.global_result != 0)
@ -37,7 +37,7 @@ int main(int argc, char** argv)
// Part 2
prepare_test_2(test);
sleep(10);
test.maxscales->wait_for_monitor();
check_test_2(test);
if (test.global_result != 0)
@ -47,7 +47,7 @@ int main(int argc, char** argv)
// Part 3
prepare_test_3(test);
sleep(10);
test.maxscales->wait_for_monitor();
check_test_3(test);
return test.global_result;