Remove implicit initialization of all maxscales

The extra maxscale instances are only started if the test explicitly
requests it.
This commit is contained in:
Markus Mäkelä
2018-09-12 10:24:34 +03:00
parent 643480240c
commit f6840fbded
4 changed files with 19 additions and 2 deletions

View File

@ -22,6 +22,7 @@ int main(int argc, char *argv[])
char * version;
TestConnections::multiple_maxscales(true);
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(10);

View File

@ -38,6 +38,7 @@ int main(int argc, char *argv[])
bool passive;
char str[1024];
TestConnections::multiple_maxscales(true);
TestConnections * Test = new TestConnections(argc, argv);
//Test->set_timeout(10);

View File

@ -21,6 +21,7 @@ static bool check_nodes = true;
static bool manual_debug = false;
static std::string required_repl_version;
static std::string required_galera_version;
static bool multiple_maxscales = false;
}
static void signal_set(int sig, void (*handler)(int))
@ -55,6 +56,11 @@ void TestConnections::skip_maxscale_start(bool value)
maxscale::start = !value;
}
void TestConnections::multiple_maxscales(bool value)
{
maxscale::multiple_maxscales = value;
}
void TestConnections::require_repl_version(const char *version)
{
maxscale::required_repl_version = version;
@ -648,9 +654,15 @@ void TestConnections::process_template(int m, const char *template_name, const c
void TestConnections::init_maxscales()
{
for (int i = 0; i < maxscales->N; i++)
// Always initialize the first MaxScale
init_maxscale(0);
if (maxscale::multiple_maxscales)
{
init_maxscale(i);
for (int i = 1; i < maxscales->N; i++)
{
init_maxscale(i);
}
}
}

View File

@ -240,6 +240,9 @@ public:
/** Skip initial start of MaxScale */
static void skip_maxscale_start(bool value);
/** Prepare multiple maxscale instances */
static void multiple_maxscales(bool value);
/** Test requires a certain backend version */
static void require_repl_version(const char *version);
static void require_galera_version(const char *version);