Speed up lots_of_rows
The test inserted 200k rows with autocommit enabled which made it very slow. Wrapping the inserts inside a transaction gives the test a significant speed boost.
This commit is contained in:
parent
54f4c6ff73
commit
b1859cc7a5
@ -17,18 +17,22 @@ int main(int argc, char *argv[])
|
||||
Test->connect_maxscale();
|
||||
create_t1(Test->conn_rwsplit);
|
||||
|
||||
Test->tprintf("INSERTing data\n");
|
||||
Test->tprintf("INSERTing data");
|
||||
|
||||
Test->try_query(Test->conn_rwsplit, "BEGIN");
|
||||
for (int i = 0; i < 2000; i++)
|
||||
{
|
||||
Test->set_timeout(20);
|
||||
create_insert_string(sql, 100, i);
|
||||
Test->try_query(Test->conn_rwsplit, sql);
|
||||
}
|
||||
Test->tprintf("done, sleeping\n");
|
||||
Test->try_query(Test->conn_rwsplit, "COMMIT");
|
||||
|
||||
Test->tprintf("done, syncing slaves");
|
||||
Test->stop_timeout();
|
||||
sleep(20);
|
||||
Test->tprintf("Trying SELECT\n");
|
||||
Test->set_timeout(30);
|
||||
Test->repl->sync_slaves();
|
||||
Test->tprintf("Trying SELECT");
|
||||
Test->set_timeout(60);
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "SELECT * FROM t1");
|
||||
|
||||
Test->check_maxscale_alive();
|
||||
|
Loading…
x
Reference in New Issue
Block a user