diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 88a580858e2..ce4f9bda6c2 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -612,6 +612,16 @@ sub run_worker ($) { $SIG{INT}= sub { exit(1); }; + # Connect to server + my $server = new IO::Socket::INET + ( + PeerAddr => 'localhost', + PeerPort => $server_port, + Proto => 'tcp' + ); + mtr_error("Could not connect to server at port $server_port: $!") + unless $server; + # -------------------------------------------------------------------------- # Set worker name # -------------------------------------------------------------------------- @@ -634,16 +644,6 @@ sub run_worker ($) { environment_setup(); - # Connect to server - my $server = new IO::Socket::INET - ( - PeerAddr => 'localhost', - PeerPort => $server_port, - Proto => 'tcp' - ); - mtr_error("Could not connect to server at port $server_port: $!") - unless $server; - # Read hello from server which it will send when shared # resources have been setup my $hello= <$server>;