summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/lib/My/SysInfo.pm15
-rwxr-xr-xmysql-test/mysql-test-run.pl1
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index 8cb399c73ba..f1ba5fb610f 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -126,6 +126,15 @@ sub new {
\&_unamex,
);
+ # Detect virtual machines
+ my $isvm= 0;
+
+ if (IS_WINDOWS) {
+ # Detect vmware service
+ $isvm= `tasklist` =~ /vmwareservice/i;
+ }
+ $self->{isvm}= $isvm;
+
foreach my $method (@info_methods){
if ($method->($self)){
return $self;
@@ -174,6 +183,12 @@ sub min_bogomips {
return $bogomips;
}
+sub isvm {
+ my ($self)= @_;
+
+ return $self->{isvm};
+}
+
# Prit the cpuinfo
sub print_info {
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 64bb21479ce..20fdc6704da 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -279,6 +279,7 @@ sub main {
}
$opt_parallel= 8 if ($opt_parallel > 8);
$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");
}