Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-33078 SysInfo.pm reports incorrect CPU count on macOS #3238

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion mysql-test/lib/My/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use File::Path;
use Carp;

use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
native_path posix_path mixed_path
check_socket_path_length process_alive open_for_append);

Expand Down Expand Up @@ -70,6 +70,14 @@ BEGIN {
}
}

BEGIN {
if ($^O eq "darwin") {
eval 'sub IS_MAC { 1 }';
}
else {
eval 'sub IS_MAC { 0 }';
}
}

#
# native_path
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ sub main {
{
$opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1;
}
elsif (IS_MAC)
{
$opt_parallel= `sysctl -n hw.ncpu`;
}
else
{
my $sys_info= My::SysInfo->new();
Expand Down