add tests
This commit is contained in:

committed by
Markus Mäkelä

parent
dbfd631fed
commit
8c6ca38a8a
41
maxscale-system-test/mxs827_write_timeout.cpp
Normal file
41
maxscale-system-test/mxs827_write_timeout.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file mxs827_write_timeout "ReadWriteSplit only keeps used connection alive, query crashes after unused connection times out"
|
||||
* - SET wait_timeout=20
|
||||
* - do only SELECT during 30 seconds
|
||||
* - try INSERT
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include "testconnections.h"
|
||||
#include "sql_t1.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TestConnections * Test = new TestConnections(argc, argv);
|
||||
Test->set_timeout(10);
|
||||
Test->connect_maxscale();
|
||||
|
||||
Test->try_query(Test->conn_rwsplit, "SET wait_timeout=20");
|
||||
|
||||
create_t1(Test->conn_rwsplit);
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
Test->tprintf("Trying query %d\n", i);
|
||||
Test->set_timeout(10);
|
||||
Test->try_query(Test->conn_rwsplit, "SELECT 1");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
Test->try_query(Test->conn_rwsplit, "INSERT INTO t1 VALUES (1, 1)");
|
||||
|
||||
Test->check_maxscale_alive();
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
return rval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user