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