mariadb/mysql-test/t/pool_of_threads.test
unknown 92fc426386 Speed up mtr --parallel=<lots> by scheduling some slow tests earlier.
The patch also fixes a race in rpl_stop_slave.test.

On machines with lots of CPU and memory, something like `mtr --parallel=10`
can speed up the test suite enormously. However, we have a few test cases
that run for long (several minutes), and if we are unlucky and happen to
schedule those towards the end of the test suite, we end up with most
workers idle while waiting for the last slow test to end, significantly
delaying the finish of the entire suite.

Improve this by marking the offending tests as taking "long", and trying
to schedule those tests early. This reduces the time towards the end of
the test suite run where some workers are waiting with nothing to do for
the remaining workers each to finish their last test.

Also, the rpl_stop_slave test had a race which could cause it to take
a 300 seconds debug_sync timeout; this is fixed.

Testing on a 4-core 8GB machine, this patch speeds up the test suite with
around 30% for --parallel=10 (debug build), allowing to run the entire
suite in 5 minutes.
2011-01-03 15:33:39 +01:00

84 lines
2 KiB
Text

# Start with thread_handling=pool-of-threads
# and run a number of tests
-- source include/have_pool_of_threads.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/long_test.inc
-- source include/common-tests.inc
# Test that we cannot have more simultaneous connections than
# --thread-pool-size on the standard port, but _can_ have additional
# connections on the extra port.
# First set two connections running, and check that extra connection
# on normal port fails due to--thread-pool-size=2
connection default;
send SELECT sleep(5);
connect(con2,localhost,root,,);
connection con2;
send SELECT sleep(5);
--sleep 1
--disable_abort_on_error
--disable_result_log
--disable_query_log
connect(con3,localhost,root,,);
--enable_query_log
--enable_result_log
--enable_abort_on_error
let $error = $mysql_errno;
if (!$error)
{
--echo # -- Error: managed to establish more than --thread-pool-size connections
}
if ($error)
{
--echo # -- Success: more than --thread-pool-size normal connections not possible
}
connection default;
--reap
connection con2;
--reap
# Now try again, but this time use the extra port to successfully connect.
connection default;
send SELECT sleep(5);
connection con2;
send SELECT sleep(5);
--sleep 1
connect(extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
connection extracon;
SELECT 'Connection on extra port ok';
connect(extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
connection extracon2;
SELECT 'Connection on extra port 2 ok';
--disable_abort_on_error
--disable_result_log
--disable_query_log
connect(extracon3,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
--enable_query_log
--enable_result_log
--enable_abort_on_error
let $error = $mysql_errno;
if (!$error)
{
--echo # -- Error: managed to establish more than --extra-max-connections + 1 connections
}
if ($error)
{
--echo # -- Success: more than --extra-max-connections + 1 normal connections not possible
}
connection default;
--reap
connection con2;
--reap