Bug #37481 main.status fails randomly
Submitted: 18 Jun 2008 13:53 Modified: 4 Feb 2009 18:30
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.1, 6.0 OS:Any
Assigned to: Davi Arnaut CPU Architecture:Any
Tags: pushbuild, sporadic, test failure

[18 Jun 2008 13:53] Alexander Nozdrin
Description:
status.test fails randomly

The output is:
----------------------------------------------------------------
@@ -189,6 +189,7 @@
 FLUSH STATUS;
 SELECT * FROM v1 WHERE NAME = 'Threads_connected' AND VALUE < @tc;
 NAME	VALUE
+THREADS_CONNECTED	3
 SELECT * FROM v1 WHERE NAME = 'Threads_running' AND VALUE < @tr;
 NAME	VALUE
 DROP VIEW v1;
----------------------------------------------------------------

or

----------------------------------------------------------------
@@ -185,6 +185,7 @@
 SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
 SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
 NAME
+THREADS_CREATED
 SELECT VALUE INTO @tr FROM v1 WHERE NAME = 'Threads_running';
 FLUSH STATUS;
 SELECT * FROM v1 WHERE NAME = 'Threads_connected' AND VALUE < @tc;
----------------------------------------------------------------

or

----------------------------------------------------------------
@@ -20,7 +20,7 @@
 unlock tables;
 show status like 'Table_locks_waited';
 Variable_name	Value
-Table_locks_waited	1
+Table_locks_waited	2
 drop table t1;
 set global general_log = @old_general_log;
 select 1;
----------------------------------------------------------------

How to repeat:
https://intranet.mysql.com/secure/pushbuild/xref.pl?testname=main.status
[25 Jun 2008 14: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/48495

2682 Davi Arnaut	2008-06-25
      Disable main.status test case due to Bug#37481
[25 Jun 2008 14:48] 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/48497

2682 Davi Arnaut	2008-06-25
      Disable main.status test case due to Bug#37481
[26 Jun 2008 13:17] Bugs System
Pushed into 6.0.6-alpha
[26 Jun 2008 13:19] Bugs System
Pushed into 6.0.6-alpha
[2 Jul 2008 10:35] Matthias Leich
Setting status back to verified, because the
pushed code is no a fix. It just disables the test.
[21 Aug 2008 13:47] Georgi Kodinov
Seen in 5.1 as well : http://tinyurl.com/6rglyf
[1 Oct 2008 14:18] 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/54956

2754 Davi Arnaut	2008-10-01
      Bug#37481: status.test fails randomly
      
      Disable concurrent inserts as it might cause the lock wait
      values to fluctuate during tests and ensure that tables are
      unlocked after a insert by sending a dummy select query. This
      will ensure that a posterior request for a read lock on the
      table won't wait (Table_locks_waited).
      
      Remove comments that calculated the Table_locks_immediate. This
      value is not tested anymore and it's calculation did not
      reflect the actual value.
[3 Oct 2008 11:41] 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/55232

2760 Davi Arnaut	2008-10-03
      Bug#37481: status.test fails randomly
      
      The problem was that the test was trying to obtain a lock on
      a table in one connection without ensuring that a insert which
      was executed in another connection had released the lock on the
      same table.
      
      The solution is to add a dummy select query after the insert to
      ensure that the table is unlocked and closed by the time it tries
      to lock it again. This is enough to prevent test failures described
      in the bug report. As an extra safety measure, concurrent inserts
      are disabled.
      
      Remove comments that calculated the Table_locks_immediate. This
      value is not tested anymore and it's calculation did not reflect
      the actual value.
[3 Oct 2008 11:44] Davi Arnaut
Queued to 5.1-bugteam
[8 Oct 2008 14:38] Davi Arnaut
One of the causes of the failure was fixed by Bug#39916
[9 Oct 2008 17:41] Bugs System
Pushed into 5.1.30  (revid:davi.arnaut@sun.com-20081003114045-868k6e780u21mxnw) (version source revid:mats@sun.com-20081008113713-2vxny72m5w1tywoi) (pib:4)
[17 Oct 2008 16:46] Bugs System
Pushed into 6.0.8-alpha  (revid:davi.arnaut@sun.com-20081003114045-868k6e780u21mxnw) (version source revid:davi.arnaut@sun.com-20081003124452-q1g6yx7zn7yij269) (pib:5)
[28 Oct 2008 21:05] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:davi.arnaut@sun.com-20081003114045-868k6e780u21mxnw) (version source revid:tomas.ulin@sun.com-20081028140209-u4emkk1xphi5tkfb) (pib:5)
[28 Oct 2008 22:24] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:davi.arnaut@sun.com-20081003114045-868k6e780u21mxnw) (version source revid:tomas.ulin@sun.com-20081028194045-0353yg8cvd2c7dd1) (pib:5)
[1 Nov 2008 9:50] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:davi.arnaut@sun.com-20081003114045-868k6e780u21mxnw) (version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)
[20 Jan 2009 23:22] 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/63643

2967 Davi Arnaut	2009-01-20
      Bug#37481: status.test fails randomly
      
      The problem is that there is no reliable way to compare the
      values of Threads_running and Threads_running as threads might
      came and go (spurious) during the execution of the test.
      
      The solution is to simply remove the test case as there is no
      obvious explanation other then the fluctuation of the values.
      Also, bugs reveled by this test case that are now covered with
      other tests, so no harm is done.
[29 Jan 2009 15:55] 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/64515

2803 Andrei Elkin	2009-01-29
      Bug #37481  main.status fails randomly
      
      An alternative patch.
[29 Jan 2009 16:34] 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/64527

2986 Davi Arnaut	2009-01-29
      Bug#37481: status.test fails randomly
      
      The problem is that there is no reliable way to compare the
      values of Threads_running and Threads_running as threads might
      came and go (spurious) during the execution of the test.
      
      The solution is to only test that Threads_connected is less the
      Threads_created as originally intended.
[29 Jan 2009 18:47] Davi Arnaut
Queued to 6.0-bugteam
[4 Feb 2009 11:17] Bugs System
Pushed into 6.0.10-alpha (revid:kostja@sun.com-20090204104420-mw1i2u9lum4bxjo6) (version source revid:davi.arnaut@sun.com-20090129163346-9lx40gi4dimb693p) (merge vers: 6.0.10-alpha) (pib:6)
[4 Feb 2009 18:30] Paul DuBois
Test case changes. No changelog entry needed.