Reset situation after test

If node00 is not the master when a test is started, the cleanup
performed by TestConnections takes considerable time.

By restoring the sitation back to normal before ending the test,
the startup time of the next test can be shortened significantly.
This commit is contained in:
Johan Wikman 2018-01-09 10:43:26 +02:00
parent a4c4c26ab9
commit a4dc99d07c

View File

@ -145,7 +145,8 @@ void run(TestConnections& test)
test.repl->sync_slaves();
cout << "\nTrying to do manual switchover to server2" << endl;
const char* zCommand = "call command mysqlmon switchover MySQL-Monitor server2 server1";
const char* zCommand;
zCommand = "call command mysqlmon switchover MySQL-Monitor server2 server1";
test.maxscales->execute_maxadmin_command_print(0, (char*)zCommand);
sleep(5);
@ -154,6 +155,19 @@ void run(TestConnections& test)
expect(test, "server2", "Master", "Running");
expect(test, "server3", "Slave", "Running");
expect(test, "server4", "Slave", "Running");
cout << "\nResetting situation." << endl;
cout << "\nTrying to do manual switchover to server1" << endl;
zCommand = "call command mysqlmon switchover MySQL-Monitor server1 server2";
test.maxscales->execute_maxadmin_command_print(0, (char*)zCommand);
sleep(5);
expect(test, "server1", "Master", "Running");
expect(test, "server2", "Slave", "Running");
expect(test, "server3", "Slave", "Running");
expect(test, "server4", "Slave", "Running");
}
}