mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-18 01:33:14 +00:00
pt-fifo-split: Fix for the blocking tests
This commit is contained in:
@@ -41,8 +41,14 @@ my @fifo;
|
|||||||
while (kill 0, $pid) {
|
while (kill 0, $pid) {
|
||||||
if ( -e $fifo ) {
|
if ( -e $fifo ) {
|
||||||
eval {
|
eval {
|
||||||
|
local $SIG{ALRM} = sub { die "read timeout" };
|
||||||
|
alarm 3;
|
||||||
my $contents = slurp_file($fifo);
|
my $contents = slurp_file($fifo);
|
||||||
push @fifo, $contents;
|
push @fifo, $contents;
|
||||||
|
alarm 0;
|
||||||
|
};
|
||||||
|
if (my $e = $@) {
|
||||||
|
die $e unless $e =~ /\Aread timeout\z/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,8 +78,14 @@ PerconaTest::wait_until(sub { -p $fifo });
|
|||||||
while (kill 0, $pid) {
|
while (kill 0, $pid) {
|
||||||
if ( -e $fifo ) {
|
if ( -e $fifo ) {
|
||||||
eval {
|
eval {
|
||||||
|
local $SIG{ALRM} = sub { die "read timeout" };
|
||||||
|
alarm 3;
|
||||||
my $contents = slurp_file($fifo);
|
my $contents = slurp_file($fifo);
|
||||||
push @fifo, $contents;
|
push @fifo, $contents;
|
||||||
|
alarm 0;
|
||||||
|
};
|
||||||
|
if (my $e = $@) {
|
||||||
|
die $e unless $e =~ /\Aread timeout\z/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user