mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 23:45:44 +00:00
Redirect sys cmd 2>/dev/null in pt-kill tests to avoid false-positive errors.
This commit is contained in:
@@ -36,14 +36,14 @@ is(
|
||||
'No output without --print'
|
||||
);
|
||||
|
||||
chomp($output = `cat $out`),
|
||||
chomp($output = `cat $out 2>/dev/null`),
|
||||
is(
|
||||
$output,
|
||||
'hello',
|
||||
'--execute-command'
|
||||
);
|
||||
|
||||
diag(`rm $out`);
|
||||
diag(`rm $out 2>/dev/null`);
|
||||
|
||||
SKIP: {
|
||||
skip 'Cannot connect to sandbox master', 2 unless $master_dbh;
|
||||
@@ -59,7 +59,7 @@ SKIP: {
|
||||
'--print with --execute-command'
|
||||
);
|
||||
|
||||
chomp($output = `cat $out`);
|
||||
chomp($output = `cat $out 2>/dev/null`);
|
||||
is(
|
||||
$output,
|
||||
'batty',
|
||||
@@ -68,7 +68,7 @@ SKIP: {
|
||||
|
||||
# Let our select sleep(2) go away before other tests are ran.
|
||||
sleep 1;
|
||||
diag(`rm $out`);
|
||||
diag(`rm $out 2>/dev/null`);
|
||||
|
||||
# Don't make zombies (https://bugs.launchpad.net/percona-toolkit/+bug/919819)
|
||||
$master_dbh->do("USE pt_kill_zombie_test");
|
||||
|
@@ -54,20 +54,20 @@ SKIP: {
|
||||
'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
|
||||
# #########################################################################
|
||||
`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`;
|
||||
like(
|
||||
$output,
|
||||
qr{PID file /tmp/pt-script.pid already exists},
|
||||
'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.
|
||||
|
Reference in New Issue
Block a user