Redirect sys cmd 2>/dev/null in pt-kill tests to avoid false-positive errors.

This commit is contained in:
Daniel Nichter
2012-10-20 13:26:33 -06:00
parent ca2675dd98
commit 85a0616ec3
2 changed files with 7 additions and 7 deletions

View File

@@ -36,14 +36,14 @@ is(
'No output without --print' 'No output without --print'
); );
chomp($output = `cat $out`), chomp($output = `cat $out 2>/dev/null`),
is( is(
$output, $output,
'hello', 'hello',
'--execute-command' '--execute-command'
); );
diag(`rm $out`); diag(`rm $out 2>/dev/null`);
SKIP: { SKIP: {
skip 'Cannot connect to sandbox master', 2 unless $master_dbh; skip 'Cannot connect to sandbox master', 2 unless $master_dbh;
@@ -59,7 +59,7 @@ SKIP: {
'--print with --execute-command' '--print with --execute-command'
); );
chomp($output = `cat $out`); chomp($output = `cat $out 2>/dev/null`);
is( is(
$output, $output,
'batty', 'batty',
@@ -68,7 +68,7 @@ SKIP: {
# Let our select sleep(2) go away before other tests are ran. # Let our select sleep(2) go away before other tests are ran.
sleep 1; sleep 1;
diag(`rm $out`); diag(`rm $out 2>/dev/null`);
# Don't make zombies (https://bugs.launchpad.net/percona-toolkit/+bug/919819) # Don't make zombies (https://bugs.launchpad.net/percona-toolkit/+bug/919819)
$master_dbh->do("USE pt_kill_zombie_test"); $master_dbh->do("USE pt_kill_zombie_test");

View File

@@ -54,20 +54,20 @@ SKIP: {
'PID file removed' 'PID file removed'
); );
diag(`rm -rf /tmp/pt-kill.log`); diag(`rm -rf /tmp/pt-kill.log 2>/dev/null`);
} }
# ######################################################################### # #########################################################################
# Issue 391: Add --pid option to all scripts # Issue 391: Add --pid option to all scripts
# ######################################################################### # #########################################################################
`touch /tmp/pt-script.pid`; diag(`touch /tmp/pt-script.pid`);
$output = `$cmd --test-matching $trunk/t/lib/samples/pl/recset006.txt --match-state Locked --print --pid /tmp/pt-script.pid 2>&1`; $output = `$cmd --test-matching $trunk/t/lib/samples/pl/recset006.txt --match-state Locked --print --pid /tmp/pt-script.pid 2>&1`;
like( like(
$output, $output,
qr{PID file /tmp/pt-script.pid already exists}, qr{PID file /tmp/pt-script.pid already exists},
'Dies if PID file already exists (--pid without --daemonize) (issue 391)' 'Dies if PID file already exists (--pid without --daemonize) (issue 391)'
); );
`rm -rf /tmp/pt-script.pid`; diag(`rm -rf /tmp/pt-script.pid 2>/dev/null`);
# ############################################################################# # #############################################################################
# Done. # Done.