Make mxs548_short_session_change_user lighter

Removed the inserts from the test. They don't make any functional
difference and it only slows the whole system down.

Also reduced the number of threads doing the change user command. This
should reduce the CPU usage of the test.
This commit is contained in:
Markus Mäkelä 2020-07-14 08:49:18 +03:00
parent 268b684c01
commit fcb78108be
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -18,23 +18,6 @@
std::atomic<bool> keep_running {true};
void query_thread_master(TestConnections& test)
{
auto conn = test.repl->get_connection(0);
std::vector<char> sql;
sql.reserve(1000000);
create_insert_string(&sql[0], 5000, 2);
test.expect(conn.connect(), "Connection should work: %s", conn.error());
while (keep_running && test.ok())
{
test.expect(conn.query(sql.data()), "Query failed: %s", conn.error());
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
void query_thread(TestConnections& test)
{
while (keep_running && test.ok())
@ -79,12 +62,7 @@ int main(int argc, char** argv)
std::vector<std::thread> threads;
test.stop_timeout();
for (int i = 0; i < 3; i++)
{
threads.emplace_back(query_thread_master, std::ref(test));
}
for (int i = 0; i < 40; i++)
for (int i = 0; i < 5; i++)
{
threads.emplace_back(query_thread, std::ref(test));
}