From fcb78108be3dd0ee6550e434fcf328a88df289e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 14 Jul 2020 08:49:18 +0300 Subject: [PATCH] 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. --- .../mxs548_short_session_change_user.cpp | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/maxscale-system-test/mxs548_short_session_change_user.cpp b/maxscale-system-test/mxs548_short_session_change_user.cpp index 7111ff5f3..cb8f9b73d 100644 --- a/maxscale-system-test/mxs548_short_session_change_user.cpp +++ b/maxscale-system-test/mxs548_short_session_change_user.cpp @@ -18,23 +18,6 @@ std::atomic keep_running {true}; -void query_thread_master(TestConnections& test) -{ - auto conn = test.repl->get_connection(0); - - std::vector 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 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)); }