Skip to content

Commit

Permalink
selection of binary went wrong on Travis, so it started
Browse files Browse the repository at this point in the history
an old mongod binary on the Travis server.
  • Loading branch information
MARTIMM committed May 17, 2016
1 parent 9575605 commit b4d47ef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
17 changes: 9 additions & 8 deletions lib/MongoDB/Server/Control.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ class Server::Control {
my Hash $config = MongoDB::Config.instance.config;
my Str $mongodb-server-path;

# Can be configured in config file
#
if not $mongodb-server-path.defined and $config<Binaries>:exists
and $config<Binaries>{$binary}:exists
and $config<Binaries>{$binary}.IO ~~ :x {

$mongodb-server-path = $config<Binaries>{$binary};
}

# On linuxes it should be in /usr/bin
#
if not $mongodb-server-path.defined and $*KERNEL.name eq 'linux' {
Expand Down Expand Up @@ -185,14 +194,6 @@ class Server::Control {
}
}

# Can be configured in config file
#
if not $mongodb-server-path.defined and $config<Binaries>:exists
and $config<Binaries>{$binary}:exists {

$mongodb-server-path = $config<Binaries>{$binary};
}

$mongodb-server-path;
}
}
Expand Down
8 changes: 4 additions & 4 deletions t/100-Server.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ my MongoDB::Test-support $ts .= new;
#-------------------------------------------------------------------------------
subtest {

my $p4 = $ts.server-control.get-port-number('s4');
my MongoDB::Server $server .= new(:server-name("localhost:$p4"));
my $p3 = $ts.server-control.get-port-number('s3');
my MongoDB::Server $server .= new(:server-name("localhost:$p3"));

my MongoDB::Server::Monitor $monitor .= new(:$server);
$monitor.start-monitor;
Expand Down Expand Up @@ -84,8 +84,8 @@ subtest {
#-------------------------------------------------------------------------------
subtest {

my $p4 = $ts.server-control.get-port-number('s4');
my MongoDB::Server $server .= new(:server-name("localhost:$p4"));
my $p3 = $ts.server-control.get-port-number('s3');
my MongoDB::Server $server .= new(:server-name("localhost:$p3"));
is $server.get-status, MongoDB::C-UNKNOWN-SERVER, "Status is Unknown";

$server.server-init;
Expand Down
2 changes: 1 addition & 1 deletion t/101-Server.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ my MongoDB::Server $server;
#-------------------------------------------------------------------------------
subtest {

$client = $ts.get-connection(:server(4));
$client = $ts.get-connection(:server(3));
my MongoDB::Server $server = $client.select-server;
ok $server.defined, 'Connection server available';

Expand Down
4 changes: 2 additions & 2 deletions t/Test-support.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Test-support {
submethod BUILD ( ) {

# Init here because of need in BUILD later
$!nbr-of-servers = 4;
$!nbr-of-servers = 3;
$!server-range = (^$!nbr-of-servers + 1);

#-----------------------------------------------------------------------------
Expand All @@ -37,7 +37,7 @@ class Test-support {
unless 'Sandbox'.IO ~~ :d {

mkdir( 'Sandbox', 0o700);
my Int $start-portnbr = 65000;
my Int $start-portnbr = 65010;
my Str $config-text = Q:qq:to/EOCONFIG/;
# Configuration file for the servers in the Sandbox
Expand Down

0 comments on commit b4d47ef

Please sign in to comment.