#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/ based on revid:guilhem@stripped
2707 Guilhem Bichot 2008-12-05
Fix for BUG#41102 "Maria: maria-no-logging.test fails randomly on Win64"
added:
mysql-test/include/mysqladmin_shutdown.inc
mysql-test/include/wait_until_disconnected.inc
modified:
mysql-test/include/maria_empty_logs.inc
mysql-test/include/wait_until_connected_again.inc
per-file messages:
mysql-test/include/maria_empty_logs.inc
move mysqladmin call to include file for reusal (so that others don't have to hit the same bug in their tests);
this include file additionally waits for disconnection. Reasons for BUG#41102:
- in maria-no-logging.test, we shut down mysqld in maria_empty_logs.inc, remove logs, tell mtr that it can
restart mysqld, then wait for being connected (wait_until_connected_again.inc), then send commands to new mysqld.
- but under Windows "mysqladmin shutdown" does not wait for mysqld to be down, so we accidentally removed logs
while it was shutting down, wait_until_connected_again found that we were connected (because it was shutting
down slowly, connections were not yet broken), sent new commands, and one of them failed because mysqld finally
closed connections.
- the fix is to just wait for disconnection after shutdown.
- in a sense, the catch is the "again" in wait_until_connected_again.inc...
mysql-test/include/mysqladmin_shutdown.inc
shutdown with mysqladmin AND waiting for shutdown to complete (needed on Windows)
mysql-test/include/wait_until_connected_again.inc
comment
mysql-test/include/wait_until_disconnected.inc
script which waits until connection is lost
=== modified file 'mysql-test/include/maria_empty_logs.inc'
--- a/mysql-test/include/maria_empty_logs.inc 2008-06-26 09:32:22 +0000
+++ b/mysql-test/include/maria_empty_logs.inc 2008-12-05 14:08:09 +0000
@@ -13,7 +13,7 @@ append_file $MYSQLTEST_VARDIR/tmp/master
wait-maria_empty_logs.inc
EOF
---exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= shutdown 2>&1;
+--source include/mysqladmin_shutdown.inc
if (!$mel_keep_control_file)
{
=== added file 'mysql-test/include/mysqladmin_shutdown.inc'
--- a/mysql-test/include/mysqladmin_shutdown.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/mysqladmin_shutdown.inc 2008-12-05 14:08:09 +0000
@@ -0,0 +1,7 @@
+# Initiates a clean shutdown of the server and waits for its completion
+
+--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= shutdown 2>&1;
+
+# On Windows mysqladmin does not wait for shutdown to be finished,
+# so we have to monitor this with our connection:
+--source include/wait_until_disconnected.inc
=== modified file 'mysql-test/include/wait_until_connected_again.inc'
--- a/mysql-test/include/wait_until_connected_again.inc 2008-02-06 17:04:06 +0000
+++ b/mysql-test/include/wait_until_connected_again.inc 2008-12-05 14:08:09 +0000
@@ -2,6 +2,9 @@
# Include this script to wait until the connection to the
# server has been restored or timeout occurs.
# You should have done --enable_reconnect first
+# When you change this file you may have to chance its cousin
+# wait_until_disconnected.inc
+
--disable_result_log
--disable_query_log
let $counter= 5000;
=== added file 'mysql-test/include/wait_until_disconnected.inc'
--- a/mysql-test/include/wait_until_disconnected.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/wait_until_disconnected.inc 2008-12-05 14:08:09 +0000
@@ -0,0 +1,24 @@
+#
+# Include this script after a shutdown to wait until the connection
+# to the server has been lost or timeout occurs.
+# When you change this file you may have to chance its cousin
+# wait_until_connected_again.inc
+
+--disable_result_log
+--disable_query_log
+let $counter= 5000;
+let $mysql_errno= 0;
+while (!$mysql_errno)
+{
+ --error 0,2002,2003,2006,1053
+ show status;
+
+ dec $counter;
+ if (!$counter)
+ {
+ --die Server failed to disconnect me
+ }
+ --sleep 0.1
+}
+--enable_query_log
+--enable_result_log
| Thread |
|---|
| • bzr commit into MySQL/Maria:mysql-maria branch (guilhem:2707) Bug#41102 | Guilhem Bichot | 5 Dec |