Bug #49672 mtr should extract end of result log if mysqltest fails without output
Submitted: 14 Dec 2009 14:22 Modified: 17 Jun 2010 19:39
Reporter: Bjørn Munch Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[14 Dec 2009 14:22] Bjørn Munch
Description:
Sometimes (and seemingly at random), a test will fail but MTR gives no reason. This can happen if mysqltest does exit(1) but hasn't written anything to stderr. This is not apparent from the MTR output.

If we can get the last lines from the query log that might help analyse why this happens. Unfortunately, the test will by default be retried and when it then succeeds the test log is overwritten. Besides, having it in the MTR log will make it more easily accessible.

How to repeat:
Seems random, not repeatable.

Suggested fix:
Extract last 20 lines, like we already do after timeout, IF mysqltest hasn't written anything before failing.  This could also be done if mysqltest exits with an unknown exit code.
[15 Dec 2009 9:13] 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/94073

2866 Bjorn Munch	2009-12-15
      Bug #49672 mtr should extract end of result log if mysqltest fails without output
      Extracts last 20 lines if no output after failure
[15 Dec 2009 12:03] Bjørn Munch
Please disregard previous comment, this patch already does save output to separate file!
[15 Dec 2009 12:07] Bjørn Munch
Please disregard the "please disregard", I added that to the wrong bug!
[5 Jan 2010 22:21] Timothy Smith
The patch looks fine.  I think it would be nice to make a function to provide this log file name, instead of cut-n-paste from elsewhere:

my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log";

But it's not a big deal and I guess it's unlikely to cause much of a maintenance headache.
[6 Jan 2010 13:48] Bjørn Munch
Pushed to 5.1-mtr, trunk-mtr, next-mr-mtr, 6.0-codebase-mtr
[20 Feb 2010 9:30] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100220092844-jh07ayojyxn8uh9p) (version source revid:bjorn.munch@sun.com-20100106093632-yy2ts5rndk3cchvm) (merge vers: 6.0.14-alpha) (pib:16)
[20 Feb 2010 9:33] Bugs System
Pushed into 5.5.3-m2 (revid:alik@sun.com-20100220092622-wvhh1vfy5tjq4mhu) (version source revid:bjorn.munch@sun.com-20100106085744-tr26s8escdaiu7ky) (merge vers: 5.5.1-m2) (pib:16)
[20 Feb 2010 9:36] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100220092730-paoo5t9gcajs5dq8) (version source revid:bjorn.munch@sun.com-20100106090111-s6smcs0si1ohiiu5) (pib:16)
[23 Feb 2010 2:13] Paul DuBois
Changes to test suite. No changelog entry needed.

Setting report to Need Merge pending push to 5.1.x, Celosia.
[1 Mar 2010 8:44] Bugs System
Pushed into 5.1.45 (revid:joro@sun.com-20100301083827-xnimmrjg6bh33o1o) (version source revid:azundris@mysql.com-20100222175719-viuh0f3gdsrkgv0r) (merge vers: 5.1.45) (pib:16)
[1 Mar 2010 16:35] Paul DuBois
No changelog entry needed.
[17 Jun 2010 11:53] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:31] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:martin.skold@mysql.com-20100609140708-52rvuyq4q500sxkq) (merge vers: 5.1.45-ndb-6.2.19) (pib:16)
[17 Jun 2010 13:19] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)