mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-08 11:07:58 +00:00
Stabilize some pt-kill tests.
This commit is contained in:
@@ -47,6 +47,7 @@ diag(`rm $out`);
|
||||
|
||||
SKIP: {
|
||||
skip 'Cannot connect to sandbox master', 2 unless $master_dbh;
|
||||
$master_dbh->do("CREATE DATABASE IF NOT EXISTS pt_kill_zombie_test");
|
||||
|
||||
system "/tmp/12345/use -e 'select sleep(2)' >/dev/null 2>&1 &";
|
||||
|
||||
@@ -70,7 +71,7 @@ SKIP: {
|
||||
diag(`rm $out`);
|
||||
|
||||
# Don't make zombies (https://bugs.launchpad.net/percona-toolkit/+bug/919819)
|
||||
system "/tmp/12345/use -e 'select sleep(2)' >/dev/null 2>&1 &";
|
||||
$master_dbh->do("USE pt_kill_zombie_test");
|
||||
|
||||
my $sentinel = "/tmp/pt-kill-test.$PID.stop";
|
||||
my $pid_file = "/tmp/pt-kill-test.$PID.pid";
|
||||
@@ -79,8 +80,8 @@ SKIP: {
|
||||
diag(`rm $pid_file 2>/dev/null`);
|
||||
diag(`rm $log_file 2>/dev/null`);
|
||||
|
||||
`$cmd --daemonize --match-info 'select sleep' --interval 1 --print --execute-command 'echo zombie > $out' --verbose --pid $pid_file --log $log_file --sentinel $sentinel`;
|
||||
sleep 1;
|
||||
`$cmd --daemonize --match-db pt_kill_zombie_test --interval 1 --print --execute-command 'echo zombie > $out' --verbose --pid $pid_file --log $log_file --sentinel $sentinel`;
|
||||
PerconaTest::wait_for_files($pid_file, $log_file, $out);
|
||||
$output = `grep Executed $log_file`;
|
||||
like(
|
||||
$output,
|
||||
|
@@ -48,7 +48,7 @@ SKIP: {
|
||||
'Log file created'
|
||||
);
|
||||
|
||||
sleep 3; # --run-time=2; if we sleep 2 we'll get intermittent failures.
|
||||
wait_until(sub { return !-f '/tmp/pt-kill.pid' });
|
||||
ok(
|
||||
!-f '/tmp/pt-kill.pid',
|
||||
'PID file removed'
|
||||
|
Reference in New Issue
Block a user