Bug #42427 MTR v2 fails with "can't write to /tmp/mysql-test-ports.sem" on Windows
Submitted: 28 Jan 2009 16:15 Modified: 17 Feb 2009 18:20
Reporter: John Embretsen Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S7 (Test Cases)
Version:2 OS:Windows (Server 2008)
Assigned to: Vladislav Vaintroub CPU Architecture:Any

[28 Jan 2009 16:15] John Embretsen
Description:
In an attempt to run MTR (v2), aka. mysql-test-run.pl, on a Windows Server 2008 64-bit host, MTR failed with an error:

"can't write to /tmp/mysql-test-ports.sem at lib/mtr_unique.pm line 66."

This does not happen when running MTR in Cygwin or after setting the MTR_BUILD_THREAD environment variable.

Output of 'perl mysql-test-run.pl insert':

(...)
Creating var directory 'G:/johnemb/bzr/mysql-6.0-rpl/mysql-test/var'...
Installing system database...
Using server port 54388

============================================================

TEST                                      RESULT   TIME (ms)
can't write to /tmp/mysql-test-ports.sem at lib/mtr_unique.pm line 66.
------------------------------------------------------------

mysql-test-run: *** ERROR: Test suite aborted

Output after setting MTR_BUILD_THREAD=1:

(...)
Creating var directory 'G:/johnemb/bzr/mysql-6.0-rpl/mysql-test/var'...
Installing system database...
Using server port 54411

============================================================

TESTworker[1] Using MTR_BUILD_THREAD 1, with reserved ports 10010..10019
                                      RESULT   TIME (ms)
------------------------------------------------------------

main.insert                              [ pass ]   2903
------------------------------------------------------------
The servers were restarted 0 times
Spent 2.903 of 27 seconds executing testcases

All 1 tests were successful.

How to repeat:
1. Branch, copy or install a recent version of the mysql-6.0-rpl bazaar branch (which is where MTR v2 is being developed currently) on a Windows host.

2. Build the MySQL server if needed. For example, this can be done in a command prompt (cmd.exe) if MS Visual Studio, Gmake and all other prerequisites are installed:

  cd mysql-6.0-rpl
  cscript win\configure.js WITH_FALCON_STORAGE_ENGINE WITH_INNODB_STORAGE_ENGINE WITH_MARIA_STORAGE_ENGINE WITH_PARTITION_STORAGE_ENGINE
  cmake -G "Visual Studio 9 2008 Win64"
  devenv MySql.sln /build debug

3. Try running MTR, e.g.:

  cd mysql-test
  perl mysql-test-run.pl insert

The error should appear soon thereafter.

4. Set MTR_BUILD_THREAD, e.g.:

  set MTR_BUILD_THREAD=1

5. Re-run MTR:

  perl mysql-test-run.pl insert

The error does no longer appear.

Suggested fix:
Make MTR work on native Windows even with no MTR_BUILD_THREAD set.
[30 Jan 2009 18:13] MySQL Verification Team
Verified on Windows Vista 64-bit:

c:\bzr\mysql-6.0-rpl-build\mysql-test>perl mysql-test-run.pl insert
Logging: mysql-test-run.pl  insert
090130 16:11:29 [Warning] Forcing shutdown of 1 plugins
MySQL Version 6.0.10
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - skipping SSL
 - binaries are debug compiled
Collecting tests...
vardir: c:/bzr/mysql-6.0-rpl-build/mysql-test/var
Removing old var directory...
Creating var directory 'c:/bzr/mysql-6.0-rpl-build/mysql-test/var'...
Installing system database...
Using server port 50691

============================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

can't write to /tmp/mysql-test-ports.sem at lib/mtr_unique.pm line 66.
mysql-test-run: *** ERROR: Test suite aborted

c:\bzr\mysql-6.0-rpl-build\mysql-test>
[30 Jan 2009 18:25] MySQL Verification Team
Thank you for the bug report.
[7 Feb 2009 14:28] John Embretsen
Seems to be fixed by Vlad. Running MTR without setting MTR_BUILD_THREAD explicitly now seems to work in mysql-6.0-falcon-team branch on Windows Server 2008. 

Fix pushed February 7 2009 (timezone CET) to mysql-6.0-falcon-team branch.
[9 Feb 2009 12:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/65599

2793 Vladislav Vaintroub	2009-02-09
      Bug#42427 : MTR v2 fails with "can't write to /tmp/mysql-test-ports.sem" on Windows
      
      - /tmp directory is not guaranteed to exist on Windows. 
      Use the value of environment variable TEMP here
[9 Feb 2009 22:33] Bugs System
Pushed into 5.1.32 (revid:davi.arnaut@sun.com-20090209214102-gj3sb3ujpnvpiy4c) (version source revid:davi.arnaut@sun.com-20090209214102-gj3sb3ujpnvpiy4c) (merge vers: 5.1.32) (pib:6)
[14 Feb 2009 13:00] Bugs System
Pushed into 6.0.10-alpha (revid:matthias.leich@sun.com-20090212211028-y72faag15q3z3szy) (version source revid:matthias.leich@sun.com-20090212211028-y72faag15q3z3szy) (merge vers: 6.0.10-alpha) (pib:6)
[17 Feb 2009 14:56] Bugs System
Pushed into 5.1.32-ndb-6.3.23 (revid:tomas.ulin@sun.com-20090217131017-6u8qz1edkjfiobef) (version source revid:tomas.ulin@sun.com-20090216083408-rmvyaxjt6mk8sg1y) (merge vers: 5.1.32-ndb-6.3.23) (pib:6)
[17 Feb 2009 16:43] Bugs System
Pushed into 5.1.32-ndb-6.4.3 (revid:tomas.ulin@sun.com-20090217134419-5ha6xg4dpedrbmau) (version source revid:tomas.ulin@sun.com-20090216083646-m8st11oj1hhfuuh5) (merge vers: 5.1.32-ndb-6.4.3) (pib:6)
[17 Feb 2009 18:20] Bugs System
Pushed into 5.1.32-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090217134216-5699eq74ws4oxa0j) (version source revid:tomas.ulin@sun.com-20090211111208-wf0acl7c1vl5653e) (merge vers: 5.1.32-ndb-6.2.17) (pib:6)
[17 Feb 2009 18:20] Paul DuBois
Test suite changes. No changelog entry needed.