MaxScale/maxscale-system-test/binlog_change_master_gtid.cpp
Markus Mäkelä c523bf74b8
Rewrite binlog_change_master tests
The tests were consistently unstable and as a result of this did not
provide any actionable output. In addition to this these two test were the
longest running tests in the whole MaxScale test suite so a re-design was
warranted.

Instead of emulating a client and a server failure, testing functionality
provides for a test that is faster, more precise and provides more
actionable output. Due to the single-threadedness of the new test, no
cross-thread depencies are present. In addition to this, the superfluous
log flushing was not done as it almost always happened after all
transactions were already complete.

The estimated savings in test time alone is around 1100 seconds (roughly
18 minutes).
2018-11-09 09:13:25 +02:00

26 lines
680 B
C++

/**
* The GTID version of binlog_change_master
*/
#include "testconnections.h"
#include "binlog_change_master_common.cpp"
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.binlog_master_gtid = true;
test.binlog_slave_gtid = true;
auto cb = [&](MYSQL* blr) {
test.try_query(blr, "STOP SLAVE");
test.try_query(blr, "CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d,"
"MASTER_USE_GTID=SLAVE_POS",
test.repl->IP[2], test.repl->port[2]);
test.try_query(blr, "START SLAVE");
};
run_test(test, cb);
return test.global_result;
}