Make mysqlmon_failover_manual2 tests faster

Removed the sleeps and used wait_for_monitor instead. Also dropped the
table at the end of the test.
This commit is contained in:
Markus Mäkelä 2018-11-19 07:45:55 +02:00
parent fd3a42ceb6
commit 778623bdfd
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -27,20 +27,6 @@ using std::stringstream;
namespace
{
void sleep(int s)
{
cout << "Sleeping " << s << " seconds" << flush;
do
{
::sleep(1);
cout << "." << flush;
--s;
}
while (s > 0);
cout << endl;
}
namespace x
{
@ -120,8 +106,6 @@ void insert_data(TestConnections& test)
void run(TestConnections& test)
{
sleep(10);
cout << "\nConnecting to MaxScale." << endl;
x::connect_maxscale(test);
@ -148,6 +132,7 @@ void run(TestConnections& test)
list_servers(test);
cout << "\nPerforming failover... " << endl;
test.maxscales->wait_for_monitor();
test.maxscales->execute_maxadmin_command_print(0, (char*)"call command mysqlmon failover MySQL-Monitor");
list_servers(test);
@ -159,8 +144,7 @@ void run(TestConnections& test)
cout << "\nClosing connection to MaxScale." << endl;
test.maxscales->close_maxscale_connections(0);
sleep(10);
test.maxscales->wait_for_monitor();
cout << "\nConnecting to MaxScale." << endl;
x::connect_maxscale(test);
@ -170,6 +154,7 @@ void run(TestConnections& test)
cout << "Trying to insert data... " << flush;
insert_data(test);
cout << "succeeded." << endl;
x::try_query(test, "DROP TABLE test.t1");
}
}