Speed up avrorouter testing
Cut test time from about 300 seconds to 200 seconds.
This commit is contained in:
parent
8c22131827
commit
ba0e3bd6b7
@ -24,15 +24,14 @@ using std::endl;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int exit_code;
|
||||
TestConnections::skip_maxscale_start(true);
|
||||
TestConnections::check_nodes(false);
|
||||
TestConnections test(argc, argv);
|
||||
test.set_timeout(600);
|
||||
test.maxscales->ssh_node(0, (char *) "rm -rf /var/lib/maxscale/avro", true);
|
||||
|
||||
/** Start master to binlogrouter replication */
|
||||
if (!test.replicate_from_master(0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
test.replicate_from_master();
|
||||
|
||||
test.set_timeout(120);
|
||||
test.repl->connect();
|
||||
@ -85,9 +84,9 @@ int main(int argc, char *argv[])
|
||||
test.add_result(1, "not enough lines in avrocheck output");
|
||||
}
|
||||
|
||||
execute_query(test.repl->nodes[0], "DROP TABLE test.t1;RESET MASTER");
|
||||
execute_query(test.repl->nodes[0], "DROP TABLE test.t1");
|
||||
test.stop_timeout();
|
||||
test.repl->fix_replication();
|
||||
test.revert_replicate_from_master();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -10,15 +10,14 @@
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int exit_code;
|
||||
TestConnections::skip_maxscale_start(true);
|
||||
TestConnections::check_nodes(false);
|
||||
TestConnections test(argc, argv);
|
||||
test.set_timeout(600);
|
||||
test.maxscales->ssh_node(0, (char *) "rm -rf /var/lib/maxscale/avro", true);
|
||||
|
||||
/** Start master to binlogrouter replication */
|
||||
if (!test.replicate_from_master(0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
test.replicate_from_master();
|
||||
|
||||
test.set_timeout(120);
|
||||
test.repl->connect();
|
||||
@ -75,7 +74,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
test.stop_timeout();
|
||||
execute_query(test.repl->nodes[0], "DROP TABLE test.t1;RESET MASTER");
|
||||
test.repl->fix_replication();
|
||||
test.revert_replicate_from_master();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -179,29 +179,14 @@ static TestConnections *Test;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
TestConnections::skip_maxscale_start(true);
|
||||
TestConnections::check_nodes(false);
|
||||
Test = new TestConnections(argc, argv);
|
||||
|
||||
Test->set_timeout(600);
|
||||
Test->maxscales->stop_maxscale(0);
|
||||
|
||||
// Remove old data files
|
||||
Test->maxscales->ssh_node_f(0, true, "rm -rf /var/lib/maxscale/avro;");
|
||||
|
||||
Test->repl->connect();
|
||||
execute_query(Test->repl->nodes[0], "DROP TABLE IF EXISTS t1;");
|
||||
Test->repl->close_connections();
|
||||
sleep(5);
|
||||
|
||||
Test->start_binlog(0);
|
||||
|
||||
Test->set_timeout(120);
|
||||
Test->maxscales->stop_maxscale(0);
|
||||
|
||||
Test->maxscales->ssh_node(0, "rm -rf /var/lib/maxscale/avro", true);
|
||||
|
||||
Test->set_timeout(120);
|
||||
Test->maxscales->start_maxscale(0);
|
||||
Test->replicate_from_master();
|
||||
|
||||
Test->set_timeout(60);
|
||||
Test->repl->connect();
|
||||
@ -225,6 +210,7 @@ int main(int argc, char *argv[])
|
||||
pthread_join(thread, NULL);
|
||||
|
||||
int rval = Test->global_result;
|
||||
Test->revert_replicate_from_master();
|
||||
delete Test;
|
||||
return rval;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ int main(int argc, char *argv[])
|
||||
TestConnections::check_nodes(false);
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
test.replicate_from_master(0);
|
||||
test.replicate_from_master();
|
||||
|
||||
if (!run_test(test))
|
||||
{
|
||||
@ -291,5 +291,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
test.check_maxscale_processes(0, 1);
|
||||
test.revert_replicate_from_master();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -36,5 +36,6 @@ int main(int argc, char** argv)
|
||||
"o-------------------------------------------------------------------o\n"
|
||||
"\n");
|
||||
|
||||
test.revert_replicate_from_master();
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -28,5 +28,7 @@ int main(int argc, char** argv)
|
||||
sleep(10);
|
||||
test.check_log_err(0, "Possible STATEMENT or MIXED", true);
|
||||
|
||||
test.revert_replicate_from_master();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -1026,13 +1026,9 @@ bool TestConnections::replicate_from_master(int m)
|
||||
bool rval = true;
|
||||
|
||||
/** Stop the binlogrouter */
|
||||
MYSQL* conn = open_conn_no_db(maxscales->binlog_port[m], maxscales->IP[m], repl->user_name, repl->password,
|
||||
ssl);
|
||||
|
||||
if (execute_query(conn, "stop slave"))
|
||||
{
|
||||
rval = false;
|
||||
}
|
||||
MYSQL* conn = open_conn_no_db(maxscales->binlog_port[m], maxscales->IP[m],
|
||||
repl->user_name, repl->password, ssl);
|
||||
execute_query_silent(conn, "stop slave");
|
||||
mysql_close(conn);
|
||||
|
||||
repl->execute_query_all_nodes("STOP SLAVE");
|
||||
@ -1062,6 +1058,21 @@ bool TestConnections::replicate_from_master(int m)
|
||||
return rval;
|
||||
}
|
||||
|
||||
void TestConnections::revert_replicate_from_master(int m)
|
||||
{
|
||||
char log_file[256] = "";
|
||||
|
||||
repl->connect();
|
||||
execute_query(repl->nodes[0], "RESET MASTER");
|
||||
find_field(repl->nodes[0], "show master status", "File", log_file);
|
||||
|
||||
for (int i = 1; i < repl->N; i++)
|
||||
{
|
||||
repl->set_slave(repl->nodes[i], repl->IP[0], repl->port[0], log_file, (char*)"4");
|
||||
execute_query(repl->nodes[i], "start slave");
|
||||
}
|
||||
}
|
||||
|
||||
int TestConnections::start_mm(int m)
|
||||
{
|
||||
int i;
|
||||
|
@ -286,6 +286,11 @@ public:
|
||||
*/
|
||||
bool replicate_from_master(int m = 0);
|
||||
|
||||
/**
|
||||
* @brief Stop binlogrouter replication from master
|
||||
*/
|
||||
void revert_replicate_from_master(int m = 0);
|
||||
|
||||
/**
|
||||
* @brief prepare_binlog clean up binlog directory, set proper access rights to it
|
||||
* @return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user