Skip to content

Commit

Permalink
Fixed mysql-test-run "Waiting ... seconds for pidfile" output
Browse files Browse the repository at this point in the history
Now the output is only written every 60 second (as it used to be before my
latest change to sleep_until_file_created()).
  • Loading branch information
montywi committed Jun 14, 2021
1 parent 6f15a8e commit 15d2a6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mysql-test/lib/mtr_process.pl
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ ($$$$)
my $warn_seconds = shift;
my $sleeptime= 10; # Milliseconds
my $loops= ($timeout * 10000) / $sleeptime;
my $message_time= 60;

for ( my $loop= 0; $loop <= $loops; $loop++ )
{
Expand All @@ -130,9 +131,10 @@ ($$$$)
mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile");

# Print extra message every $warn_seconds seconds
if ( $seconds > 1 && ($seconds*10) % ($warn_seconds*10) == 0 && $seconds < $timeout )
if ( $seconds >= $message_time)
{
my $left= $timeout - $seconds;
$message_time= $message_time+60;
my $left= $timeout - int($seconds);
mtr_warning("Waited $seconds seconds for $pidfile to be created, " .
"still waiting for $left seconds...");
}
Expand Down

0 comments on commit 15d2a6c

Please sign in to comment.