Bug #50081 Tests: mysqld--help-notwin fails with --parallel
Submitted: 5 Jan 2010 9:40 Modified: 6 Mar 2010 19:50
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.5-m3 OS:Linux
Assigned to: Guilhem Bichot CPU Architecture:Any

[5 Jan 2010 9:40] Guilhem Bichot
Description:
revision-id:jorgen.loland@sun.com-20100104095105-lluxvp8jtspihc7a
./mtr mysqld--help-notwin --parallel=4
CURRENT_TEST: main.mysqld--help-notwin
--- /home/mysql_src/bzrrepos/mysql-next-mr-bugfixing/mysql-test/r/mysqld--help-notwin.result	2010-01-04 23:23:48.000000000 +0300
+++ /home/mysql_src/bzrrepos/mysql-next-mr-bugfixing/mysql-test/r/mysqld--help-notwin.reject	2010-01-05 12:33:07.000000000 +0300
@@ -744,7 +744,7 @@
 concurrent-insert                   AUTO
 connect-timeout                     10
 console                             FALSE
-datadir                             MYSQLTEST_VARDIR/install.db/
+datadir                             MYSQL_TEST_DIR/var/install.db/
 date-format                         %Y-%m-%d
 datetime-format                     %Y-%m-%d %H:%i:%s
 default-character-set               latin1
@@ -898,7 +898,7 @@
 skip-slave-start                    FALSE
 slave-compressed-protocol           FALSE
 slave-exec-mode                     STRICT
-slave-load-tmpdir                   MYSQLTEST_VARDIR/tmp/
+slave-load-tmpdir                   MYSQL_TEST_DIR/var/tmp/
 slave-net-timeout                   3600
 slave-skip-errors                   (No default value)
 slave-transaction-retries           10
@@ -926,7 +926,7 @@
 time-format                         %H:%i:%s
 timed-mutexes                       FALSE
 tmp-table-size                      16777216
-tmpdir                              MYSQLTEST_VARDIR/tmp/
+tmpdir                              MYSQL_TEST_DIR/var/tmp/

How to repeat:
./mtr mysqld--help-notwin --parallel=4

Suggested fix:
It's because the test looks for certain environment variables in the output of "mysqld --bootstrap --verbose --help" and substitutes them with constant strings, which is good per se, but those environment variables vary between when --parallel is used and when it is not used, so replacements do not happen the same way, making the test fail. In our case, without --parallel, MYSQL_TEST_VARDIR=<top>/mysql-test/var/ which will match <top>/mysql-test/var/tmp (present in the output of mysqld) and be used for replacement; but with --parallel=4, MYSQL_TEST_VARDIR=<top>/mysql-test/var/1/tmp, which does *not* match <top>/mysql-test/var/tmp; so the substitution rather happens using MYSQL_TEST_DIR (which is <top>/mysql-test/). So we get an extra "var/" left.
When you fix this, make sure to test ./mtr with different options:
--mem
--parallel=4
--tmpdir=x
--vardir=y
--tmpdir=x --vardir=y
--tmpdir=x --vardir=x
So that we can be sure that this will still work on many systems (pushbuild2 etc).
Don't just delete the test, it has recently been added by WL#4738 and is useful.
A lazy possibility is to make the test exclude the "datadir", "slave-load-tmpdir" and "tmpdir" options from output (it already excludes plugin-specific options).
[5 Jan 2010 10:26] Guilhem Bichot
Making the variables be ignored is adding them to
  @skipvars=qw/basedir open-files-limit general-log-file log
               log-slow-queries pid-file slow-query-log-file/;
in mysql-test/include/mysqld--help.inc
[6 Jan 2010 11:00] 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/96102

2960 Guilhem Bichot	2010-01-06
      Fix for BUG#50081 "Tests: mysqld--help-notwin fails with --parallel":
      eliminate 3 more "directory path" variables from the test's output (it was already
      the case for other similar ones likes slow-query-log-file).
[6 Jan 2010 15:47] 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/96146
[6 Jan 2010 15:51] Guilhem Bichot
queued to next-mr-bugfixing and 6.0-codebase-bugfixing
[12 Jan 2010 16:25] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100112162328-2sblcul1kl08bbib) (version source revid:guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38) (merge vers: 6.0.14-alpha) (pib:15)
[12 Jan 2010 16:25] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100112162142-nrjoxn6h2nrnh2o0) (version source revid:guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38) (pib:15)
[13 Jan 2010 2:56] Paul DuBois
Changes to test cases. No changelog entry needed.

Setting report to NDI pending push to Celosia.
[6 Mar 2010 10:52] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38) (merge vers: 6.0.14-alpha) (pib:16)
[6 Mar 2010 19:50] Paul DuBois
No changelog entry needed.