Add and test --[no]stalk to pt-stalk. Fix ps in pt-stalk tests. Add PerconaTest::wait_for_sh().

This commit is contained in:
Daniel Nichter
2012-02-16 13:32:46 -07:00
parent 29d9311c21
commit cd17a20119
3 changed files with 99 additions and 22 deletions

View File

@@ -287,6 +287,16 @@ sub wait_for_files {
);
}
sub wait_for_sh {
my ($cmd) = @_;
return wait_until(
sub {
my $retval = system("$cmd 2>/dev/null");
return $retval >> 8 == 0 ? 1 : 0;
}
);
};
sub _read {
my ( $fh ) = @_;
return <$fh>;