PT-139 wait_for_master returns error if no channel was specified in a multi master env

This commit is contained in:
Carlos Salguero
2017-05-12 15:44:57 -03:00
parent 5744fdf583
commit 820448fca3
3 changed files with 51 additions and 2 deletions

View File

@@ -803,6 +803,17 @@ SKIP: {
'Got warning message if we cannot determine slave in a multi source config without --channel param',
);
my $wfm = $ms->wait_for_master(
master_status => $ms->get_master_status($dbh),
slave_dbh => $slave1_dbh,
timeout => 1,
);
like(
$wfm->{error},
qr/"channel" was not specified on the command line/,
'Wait for master returned error',
);
# Now try specifying a channel name
$ms->{channel} = 'masterchan1';
$css = $ms->get_slave_status($slave1_dbh);
@@ -812,6 +823,17 @@ SKIP: {
'Returned the correct slave',
);
$wfm = $ms->wait_for_master(
master_status => $ms->get_master_status($dbh),
slave_dbh => $slave1_dbh,
timeout => 1,
);
is(
$wfm->{error},
undef,
'Wait for master returned no error',
);
$sb->stop_sandbox(qw(chan_master1 chan_master2 chan_slave1));
}
# #############################################################################