mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
t/pt-query-digest/mirror.t: Don't sleep(1), use wait_for_files() instead
This commit is contained in:
@@ -46,19 +46,17 @@ $cmd = "$trunk/bin/pt-query-digest "
|
|||||||
. "--execute h=127.1,P=12346,u=msandbox,p=msandbox --mirror 1 "
|
. "--execute h=127.1,P=12346,u=msandbox,p=msandbox --mirror 1 "
|
||||||
. "--pid $pid_file";
|
. "--pid $pid_file";
|
||||||
|
|
||||||
$ENV{PTDEBUG}=1;
|
{
|
||||||
|
local $ENV{PTDEBUG}=1;
|
||||||
`$cmd > /tmp/read_only.txt 2>&1 &`;
|
`$cmd > /tmp/read_only.txt 2>&1 &`;
|
||||||
|
}
|
||||||
$ENV{PTDEBUG}=0;
|
|
||||||
sleep 3;
|
|
||||||
|
|
||||||
$dbh1->do('select sleep(1)');
|
$dbh1->do('select sleep(1)');
|
||||||
sleep 1;
|
|
||||||
$dbh1->do('set global read_only=1');
|
$dbh1->do('set global read_only=1');
|
||||||
$dbh2->do('set global read_only=0');
|
$dbh2->do('set global read_only=0');
|
||||||
$dbh1->do('select sleep(1)');
|
$dbh1->do('select sleep(1)');
|
||||||
|
|
||||||
sleep 1;
|
PerconaTest::wait_for_files($pid_file);
|
||||||
chomp(my $pid = `cat $pid_file`);
|
chomp(my $pid = `cat $pid_file`);
|
||||||
kill 15, $pid;
|
kill 15, $pid;
|
||||||
sleep 0.25;
|
sleep 0.25;
|
||||||
|
Reference in New Issue
Block a user