Files
MaxScale/system-test/backend_auth_fail.cpp
Markus Mäkelä ca1db89994 MXS-3259: Increase connection limits
Lowering max_connections to 10 prevented the test system itself from
connecting to it. The replication slaves count towards max_connections and
with up to 15 connections in the test, the limit should be higher.
2020-10-29 15:12:49 +02:00

39 lines
968 B
C++

/**
* @backend_auth_fail.cpp Repeatedly connect to maxscale while the backends reject all connections
*
* MaxScale should not crash
*/
#include "testconnections.h"
int main(int argc, char** argv)
{
MYSQL* mysql[1000];
TestConnections* Test = new TestConnections(argc, argv);
Test->repl->execute_query_all_nodes((char*) "set global max_connections = 30;");
for (int x = 0; x < 3; x++)
{
Test->tprintf("Creating 100 connections...\n");
for (int i = 0; i < 100; i++)
{
Test->set_timeout(30);
mysql[i] = Test->maxscales->open_readconn_master_connection(0);
execute_query_silent(mysql[i], "select 1");
}
Test->stop_timeout();
for (int i = 0; i < 100; i++)
{
Test->set_timeout(30);
mysql_close(mysql[i]);
}
}
Test->check_maxscale_alive(0);
int rval = Test->global_result;
delete Test;
return rval;
}