[MDEV-27155] mysql-test-run.pl creates temporary result files in source directory after .rdiff files applying Created: 2021-12-02  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Vladislav Lesin Assignee: Vladislav Lesin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-11732 MTR leaves intermediate files after a... Closed

 Description   

mysql-test-run.pl creates temporary result files in source directory after .rdiff files applying, what can cause tests failures if several instances of mtr started.

I propose the following fix:

--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3350,16 +3350,8 @@ sub do_before_run_mysqltest($)
       push @cmd, '--binary';
     }
     push @cmd, (qw/-r - -f -s -o/, $dest, $base_result, $resfile);
-    if (-w $resdir) {
-      # don't rebuild a file if it's up to date
-      unless (-e $dest and -M $dest < -M $resfile
-                       and -M $dest < -M $base_result) {
-        run_system(@cmd);
-      }
-    } else {
-      $cmd[-3] = $dest = $opt_tmpdir . '/' . basename($dest);
-      run_system(@cmd);
-    }
+    $cmd[-3] = $dest = $opt_tmpdir . '/' . basename($dest);
+    run_system(@cmd);
     $tinfo->{result_file} = $dest;
   }
 

The drawback of this fix is that some optimization will be lost, i.e. currently temporary result file is not generated if it was already generated and there is no need to update it.



 Comments   
Comment by Vladislav Lesin [ 2022-10-05 ]

The solution could be not to create result~ files concurrently, one process can do that.

Repeat test with several workers:

./mtr test{,,,,,,}

or

while ./mtr --mysqld=--innodb-purge-threads=1 --parallel=60 --rr innodb.ps1{,,,,,}{,,,,,,,,,}; do :; done

Generated at Thu Feb 08 09:50:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.