diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-14 16:52:18 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-14 16:52:18 +0000 |
commit | 46496b1a8cbfc1bbc023da253aa05f95d47defd3 (patch) | |
tree | 5726431c14a7493c4e2ee870b7ea882752ce228d /mysql-test/mysql-test-run.pl | |
parent | c6e35276f180bdcf5517bb682c46ba7df8a08186 (diff) | |
download | mariadb-git-46496b1a8cbfc1bbc023da253aa05f95d47defd3.tar.gz |
Windows, mtr - correctly determine CPU count, for --parallel=auto
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index adabffa4219..d3f82e281e5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -431,16 +431,21 @@ sub main { my $num_tests= @$tests; if ( $opt_parallel eq "auto" ) { # Try to find a suitable value for number of workers - my $sys_info= My::SysInfo->new(); - - $opt_parallel= $sys_info->num_cpus(); - for my $limit (2000, 1500, 1000, 500){ - $opt_parallel-- if ($sys_info->min_bogomips() < $limit); + if (IS_WINDOWS) + { + $opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1; + } + else + { + my $sys_info= My::SysInfo->new(); + $opt_parallel= $sys_info->num_cpus(); + for my $limit (2000, 1500, 1000, 500){ + $opt_parallel-- if ($sys_info->min_bogomips() < $limit); + } } my $max_par= $ENV{MTR_MAX_PARALLEL} || 8; $opt_parallel= $max_par if ($opt_parallel > $max_par); $opt_parallel= $num_tests if ($opt_parallel > $num_tests); - $opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm()); $opt_parallel= 1 if ($opt_parallel < 1); mtr_report("Using parallel: $opt_parallel"); } |