From 3b2cfef63756c804d519f95146aa20f5fdbe88bf Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Tue, 8 Jan 2008 10:50:07 +0100 Subject: [PATCH] Use a tempdir name for the directory that var symlink points at, otherwise it can conflict with another MTR_BUILD_THREAD=auto run --- mysql-test/mysql-test-run.pl | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4eda93fb664..a4cf7b41310 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -539,7 +539,7 @@ sub command_line_setup { if $opt_tmpdir; # Search through list of locations that are known - # to be "fast disks" to list to find a suitable location + # to be "fast disks" to find a suitable location # Use --mem= as first location to look. my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp"); @@ -547,8 +547,8 @@ sub command_line_setup { { if ( -d $fs ) { - $opt_mem= "$fs/var"; - $opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread; + my $template= "var_${opt_mtr_build_thread}_XXXX"; + $opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0); last; } } @@ -772,7 +772,6 @@ sub set_mtr_build_thread_ports($) { mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299); print "got ".$mtr_build_thread."\n"; } - $opt_mtr_build_thread= $mtr_build_thread; $ENV{MTR_BUILD_THREAD}= $mtr_build_thread; # Calculate baseport @@ -1272,7 +1271,7 @@ sub remove_stale_vardir () { { # var is a symlink - if ( $opt_mem and readlink($opt_vardir) eq $opt_mem ) + if ( $opt_mem ) { # Remove the directory which the link points at mtr_verbose("Removing " . readlink($opt_vardir)); @@ -1282,14 +1281,6 @@ sub remove_stale_vardir () { mtr_verbose("unlink($opt_vardir)"); unlink($opt_vardir); } - elsif ( $opt_mem ) - { - # Just remove the "var" symlink - mtr_report(" - WARNING: Removing '$opt_vardir' symlink it's wrong"); - - mtr_verbose("unlink($opt_vardir)"); - unlink($opt_vardir); - } else { # Some users creates a soft link in mysql-test/var to another area