diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 25cf8f46832d..d209e520b39f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1784,9 +1784,12 @@ ($) if ( lc($opt_build_thread) eq 'auto' ) { my $found_free = 0; $build_thread = 300; # Start attempts from here + my $build_thread_upper = $build_thread + ($opt_parallel > 49 + ? $opt_parallel + : 49); while (! $found_free) { - $build_thread= mtr_get_unique_id($build_thread, 349); + $build_thread= mtr_get_unique_id($build_thread, $build_thread_upper); if ( !defined $build_thread ) { mtr_error("Could not get a unique build thread id"); }