Speed up binlog tests

The binlogrouter tests can safely use the sync_slaves functionality of the
test framework as long as a sensible timeout is used.

Cleaned up the tests by removing redundant code and allocating classes
from the stack thus removing the need to handle memory allocation.
This commit is contained in:
Markus Mäkelä
2017-09-24 20:03:02 +03:00
parent 944a5bd9c1
commit 18b0d3575e
3 changed files with 58 additions and 92 deletions

View File

@ -38,32 +38,15 @@
int main(int argc, char *argv[])
{
TestConnections test(argc, argv);
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(3000);
int options_set = 3;
if (Test->smoke)
{
options_set = 1;
}
test.binlog_cmd_option = 1;
test.start_binlog();
test_binlog(&test);
Test->repl->connect();
execute_query(Test->repl->nodes[0], (char *) "DROP TABLE IF EXISTS t1;");
Test->repl->close_connections();
sleep(5);
test.check_log_err("SET NAMES utf8mb4", false);
test.check_log_err("set autocommit=1", false);
test.check_log_err("select USER()", false);
for (int option = 0; option < options_set; option++)
{
Test->binlog_cmd_option = option;
Test->start_binlog();
test_binlog(Test);
}
Test->check_log_err("SET NAMES utf8mb4", false);
Test->check_log_err("set autocommit=1", false);
Test->check_log_err("select USER()", false);
int rval = Test->global_result;
delete Test;
return rval;
return test.global_result;
}