mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-25802 mtr: race condition if the test quickly restarts twice
expect file is always removed before starting a server. So if it exists here, it means the server started successfully, mysqltest continued executing the test, created a new expect file, and shut down the server. All while we were waiting for the server to start. In other words, if the expect file exists, the server did actually start. Even if it isn't running now. This fixes occasional failures of innodb.log_corruption (in 10.6)
This commit is contained in:
@ -40,7 +40,7 @@ BEGIN
|
||||
eval 'sub USE_NETPING { $use_netping }';
|
||||
}
|
||||
|
||||
sub sleep_until_file_created ($$$$);
|
||||
sub sleep_until_file_created ($$$$$);
|
||||
sub mtr_ping_port ($);
|
||||
|
||||
sub mtr_ping_port ($) {
|
||||
@ -102,8 +102,9 @@ sub mtr_ping_port ($) {
|
||||
|
||||
# FIXME check that the pidfile contains the expected pid!
|
||||
|
||||
sub sleep_until_file_created ($$$$) {
|
||||
sub sleep_until_file_created ($$$$$) {
|
||||
my $pidfile= shift;
|
||||
my $expectfile = shift;
|
||||
my $timeout= shift;
|
||||
my $proc= shift;
|
||||
my $warn_seconds = shift;
|
||||
@ -122,6 +123,7 @@ sub sleep_until_file_created ($$$$) {
|
||||
# Check if it died after the fork() was successful
|
||||
if ( defined $proc and ! $proc->wait_one(0) )
|
||||
{
|
||||
return 1 if -r $expectfile;
|
||||
mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
|
||||
"seconds for $pidfile to be created.");
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user