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