Bug #19594 Race in mysql-test-run.pl with parallel test runs
Submitted: 7 May 2006 19:36 Modified: 9 May 2006 9:13
Reporter: Kristian Nielsen Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.0.22, 5.1.10 OS:Windows (Windows)
Assigned to: Magnus BlÄudd CPU Architecture:Any

[7 May 2006 19:36] Kristian Nielsen
There is a race / file conflict in mysql-test-run.pl in the check_running_as_root() function.

When starting multiple test runs in parallel, the tests will race each other in writing to the same file "test_running_as_root.txt", and will occasionally fail to start the whole test because of collisions (one test tries to write the file and fails because the file is blocked by the other process with chmod(0) (or just having the file open on Windows).

How to repeat:
Difficult to repeat because of the timing dependency of the problem, but seen often in pushbuild.

Suggested fix:
Do not use a fixed filename for the test file. Instead write the test file into the $opt_vardir directory, which is where all other file operations take place anyway.