Bug #21286 mysql-test-run with --extern switch shuts down server before exit
Submitted: 25 Jul 2006 21:45 Modified: 26 Sep 2006 10:36
Reporter: Erica Moss Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.0.25 -log OS:Linux (Fedora core 5)
Assigned to: Magnus Blåudd CPU Architecture:Any

[25 Jul 2006 21:45] Erica Moss
Description:
At line 488 of the shell script:
mysql-test-extra-5.0/mysql-test/suite/updown/bin/updown-test-driver.sh

The server is started via mysql-test-run.pl using the --start-and-exit switch.  This initializes the database to prepare test cases to run and then exits leaving the server running.

At line 501 of the same script, mysql-test-run.pl is run using the --extern switch.  It is understood by SQA that this switch should cause the perl script to do the following:
1. run without initializing and starting the server
2. attach to an already running server
3. run the specified test cases
4. exit, leaving the server running

However the current behavior is that after the test case completes the server is shutdown.

How to repeat:
This can be repeated by running the script
mysql-test-extra-5.0/mysql-test/suite/updown/bin/updown-test-driver.sh

Usage documentation can be found at the top of this script
[25 Jul 2006 23:58] Omer Barnir
To simplfy. The problem is that up until recently (not sure when the --extern option (use exisitng runing server did *not* shut down the server at the end of the test. This is the expected behavior. 
Recently one of the changes to the mysql-test-run.pl changed behavior and now using --extern shuts the server down vefore exiting.
This needs to be fixed and the behavior needs to be restored to the previous one.

1) start the server
2) Run mysql-test-run.pl --extern --do=test=alias
   >> Observe the server shut down at the end of the test

Note: the use of the alias test is just an example, any test will do.
[7 Aug 2006 20:31] Erica Moss
Need to experiment further with this.  It appears that it may in fact be functioning correctly.
[25 Aug 2006 17:47] Omer Barnir
Changed status since under investigation by Eric
[26 Sep 2006 10:20] Magnus Blåudd
Will take a quick look to see if we can get this out of the way.
[26 Sep 2006 10:36] Magnus Blåudd
Tested with latest 5.0 and it works as expected. See below.

[msvensson@neptunus mysql-test]$ ./mysql-test-run.pl --do-test=alias --start-and-exit
Logging: ./mysql-test-run.pl --do-test=alias --start-and-exit
Skipping ndbcluster, mysqld not compiled with ndbcluster
Skipping SSL, mysqld not compiled with SSL
Using MTR_BUILD_THREAD = 12
Using MASTER_MYPORT    = 10120
Using MASTER_MYPORT1   = 10121
Using SLAVE_MYPORT     = 10122
Using SLAVE_MYPORT1    = 10123
Using SLAVE_MYPORT2    = 10124
Using NDBCLUSTER_PORT  = 10125
Using IM_PORT          = 10126
Using IM_MYSQLD1_PORT  = 10127
Using IM_MYSQLD2_PORT  = 10128
Killing Possible Leftover Processes
Removing Stale Files
Installing Master Database
Installing Master Database
=======================================================
Finding  Tests in the 'main' suite
Starting Tests in the 'main' suite

TEST                           RESULT
-------------------------------------------------------

alias
Servers started, exiting
[msvensson@neptunus mysql-test]$ ps   PID TTY          TIME CMD
18879 pts/13   00:00:00 bash
11487 pts/13   00:00:00 mysql-test-run.
11488 pts/13   00:00:00 mysql-test-run.
11489 pts/13   00:00:01 mysqld
11499 pts/13   00:00:00 ps
[msvensson@neptunus mysql-test]$ ./mysql-test-run.pl --do-test=alias --extern --master_port=10120 --socket=var/tmp/master.sock --user=root --force
Logging: ./mysql-test-run.pl --do-test=alias --extern --master_port=10120 --socket=var/tmp/master.sock --user=root --force
Skipping ndbcluster, mysqld not compiled with ndbcluster
Skipping SSL, mysqld not compiled with SSL
Using MTR_BUILD_THREAD = 12
Using MASTER_MYPORT    = 10120
Using MASTER_MYPORT1   = 10121
Using SLAVE_MYPORT     = 10122
Using SLAVE_MYPORT1    = 10123
Using SLAVE_MYPORT2    = 10124
Using NDBCLUSTER_PORT  = 10125
Using IM_PORT          = 10126
Using IM_MYSQLD1_PORT  = 10127
Using IM_MYSQLD2_PORT  = 10128
=======================================================
Finding  Tests in the 'main' suite
Starting Tests in the 'main' suite

TEST                           RESULT
-------------------------------------------------------

alias                          [ pass ]
-------------------------------------------------------
All 1 tests were successful.

[msvensson@neptunus mysql-test]$ ps
  PID TTY          TIME CMD
18879 pts/13   00:00:00 bash
11487 pts/13   00:00:00 mysql-test-run.
11488 pts/13   00:00:00 mysql-test-run.
11489 pts/13   00:00:01 mysqld
11522 pts/13   00:00:00 ps
[msvensson@neptunus mysql-test]$