Bug #40150 Please make mtr print result diff on all failures
Submitted: 19 Oct 2008 18:03 Modified: 21 Jan 2009 12:41
Reporter: Sven Sandberg Email Updates:
Status: Won't fix Impact on me:
None 
Category:Tests Severity:S7 (Test Cases)
Version:5.1 OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any
Tags: mtr, result diff, timeout

[19 Oct 2008 18:03] Sven Sandberg
Description:
When a test fails with timeout, there is almost no debug info (except SHOW PROCESSLIST in the last version of mtr, but it's usually not enough).

mtr should print a result diff when timeouts happen. That would make it possible to derive which command was last issued, and if anything unusual happened prior to the timeout.

This was requested in BUG#38181 and BUG#38817, both of which have been partially implemented. I'm opening this bug since it's one of the most important features missing from those requests. (Another outstanding feature request is printing stack trace under Windows, but see BUG#38817 for details.)

How to repeat:
-
[21 Oct 2008 1:11] Omer Barnir
triage: setting tag to checked as this is a feature request
[22 Oct 2008 8:50] Sven Sandberg
Additional request: timeouts sometimes happen because the server has hanged. Therefore, we should also get a stack trace from the running process. With gdb, this can be done by "gdb /path/to/mysqld PID --eval-command='thread apply all bt'"
[29 Oct 2008 16:16] Sven Sandberg
In fact, we should *always* have a result diff, no matter what type of failure it was. I think we currently don't get this if mysqltest crashes, for instance. There may be other cases too.

Please go through all mtr's execution paths and check that a result diff is always created if the test was at all started.
[13 Nov 2008 10:09] Sven Sandberg
Please ignore my additional request for stack traces: that should be fixed in BUG#40399. The present bug is only to get a result diff after every failure.
[13 Nov 2008 20: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/58701

2692 Serge Kozlov	2008-11-13
      Bug#39861:
      1. mysqltest.cc - added flush to log file after each executed command in a testcase. 
      2. mtr shows 20 last lines from test case log file if timeout reached.
      3. Optimizing the code by Magnus review.
      4. It is partially fix bug#40150
[14 Nov 2008 20:36] 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/58844

2698 Serge Kozlov	2008-11-14
      Bug#39861:
      1. mysqltest.cc - added flush to log file after each executed command in a testcase.
      2. mtr shows 20 last lines from test case log file if timeout reached.
      3. Optimizing the code by Magnus review.
      4. It is partially fix bug#40150
[21 Jan 2009 12:38] Bjørn Munch
With the fix for bug #39861 which prints the last 20 lines of test case log, the "show processlist" output and the recent fix #40399 adding stack trace from servers, I think there would be very little extra to gain from printing the result diff. This diff would most likely just show what's missing after the test hanged or timed out (which could be quite much), and that can already be deduced from the last 20 lines which should show where it stopped.
[30 Jan 2009 13:26] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463) (version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers: 6.0.10-alpha) (pib:6)
[30 Jan 2009 15:07] Bugs System
Pushed into 5.1.32 (revid:luis.soares@sun.com-20090129165946-d6jnnfqfokuzr09y) (version source revid:skozlov@mysql.com-20081114203532-hc6b88uie725xjkh) (merge vers: 5.1.31) (pib:6)
[17 Feb 2009 14:54] 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-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 16:42] 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-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 18:18] 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-20090201210519-vehobc4sy3g9s38e) (merge vers: 5.1.32-ndb-6.2.17) (pib:6)