Reduce excessive sleeping in tests

Some of the tests waited for excessively long periods of time for changes
to propagate. With a one second monitor interval, a sleep of around five
seconds should be plenty enough for all monitor related changes to be
propagated to all systems.
This commit is contained in:
Markus Mäkelä
2017-12-20 10:44:14 +02:00
parent 9962191722
commit b54dca50b5
5 changed files with 17 additions and 86 deletions

View File

@ -13,20 +13,13 @@
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int i;
Test->tprintf("Connecting to Maxscale %s\n", Test->maxscales->IP[0]);
Test->tprintf("Connecting to Maxscale %s to check its behaviour in case of blocking all backends\n",
Test->maxscales->IP[0]);
Test->maxscales->connect_maxscale(0);
for (i = 0; i < Test->repl->N; i++)
for (int i = 0; i < Test->repl->N; i++)
{
Test->set_timeout(30);
Test->tprintf("Setup firewall to block mysql on node %d\n", i);
Test->repl->block_node(i);
fflush(stdout);
}
Test->set_timeout(200);
@ -36,20 +29,16 @@ int main(int argc, char *argv[])
Test->tprintf("Checking if MaxScale is alive by connecting to MaxAdmin\n");
Test->add_result(Test->maxscales->execute_maxadmin_command(0, (char* ) "show servers"), "Maxadmin execution failed.\n");
for (i = 0; i < Test->repl->N; i++)
for (int i = 0; i < Test->repl->N; i++)
{
Test->set_timeout(30);
Test->tprintf("Setup firewall back to allow mysql on node %d\n", i);
Test->repl->unblock_node(i);
fflush(stdout);
}
Test->stop_timeout();
Test->tprintf("Sleeping 30 seconds\n");
sleep(30);
sleep(3);
Test->set_timeout(30);
Test->tprintf("Checking Maxscale is alive\n");
Test->check_maxscale_alive(0);
int rval = Test->global_result;