add tests
This commit is contained in:
committed by
Markus Mäkelä
parent
dbfd631fed
commit
8c6ca38a8a
52
maxscale-system-test/crash_out_of_files.cpp
Normal file
52
maxscale-system-test/crash_out_of_files.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @file crash_ot_of_files.cpp Tries to open to many connections, expect no crash
|
||||
* - set global max_connections = 20
|
||||
* - create load on RWSplit using big number of threads (e.g. 100)
|
||||
* - check that no backends are disconnected with error ""refresh rate limit exceeded"
|
||||
*/
|
||||
|
||||
#include "testconnections.h"
|
||||
#include "sql_t1.h"
|
||||
#include "get_com_select_insert.h"
|
||||
|
||||
#include "big_load.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TestConnections * Test = new TestConnections(argc, argv);
|
||||
|
||||
Test->set_timeout(20);
|
||||
Test->repl->execute_query_all_nodes((char *) "set global max_connections = 20;");
|
||||
|
||||
long int i1, i2;
|
||||
long int selects[256];
|
||||
long int inserts[256];
|
||||
long int new_selects[256];
|
||||
long int new_inserts[256];
|
||||
|
||||
Test->tprintf("Start load\n");
|
||||
Test->set_timeout(1200);
|
||||
load(&new_inserts[0], &new_selects[0], &selects[0], &inserts[0], 100, Test, &i1, &i2, 0, false, false);
|
||||
|
||||
Test->tprintf("restoring nodes\n");
|
||||
Test->set_timeout(60);
|
||||
Test->repl->connect();
|
||||
|
||||
for (int i = 0; i < Test->repl->N; i++)
|
||||
{
|
||||
Test->tprintf("Trying to flush node %d\n", i);
|
||||
Test->add_result(execute_query(Test->repl->nodes[i], (char *) "flush hosts;"), "node %i flush failed\n", i);
|
||||
Test->tprintf("Trying to set max_connections for node %d\n", i);
|
||||
Test->add_result(execute_query(Test->repl->nodes[i], (char *) "set global max_connections = 151;"),
|
||||
"set max_connections failed for node %d\n", i);
|
||||
}
|
||||
|
||||
Test->repl->close_connections();
|
||||
Test->stop_timeout();
|
||||
|
||||
Test->check_log_err((char *) "refresh rate limit exceeded", false);
|
||||
Test->check_maxscale_alive();
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
return rval;
|
||||
}
|
||||
Reference in New Issue
Block a user