#At file:///home/bm136801/mysql/mtr-bug-40924/
2704 Bjorn Munch 2008-12-03
Bug #40924 please print timestamp when mtr fails
Added text "Test ended at <time>" after failure reports
modified:
mysql-test/lib/mtr_report.pm
=== modified file 'mysql-test/lib/mtr_report.pm'
=== modified file 'mysql-test/lib/mtr_report.pm'
--- a/mysql-test/lib/mtr_report.pm 2008-10-23 19:27:09 +0000
+++ b/mysql-test/lib/mtr_report.pm 2008-12-03 13:11:03 +0000
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -110,22 +110,26 @@
if ($result eq 'MTR_RES_FAILED'){
+ my $timest = format_time();
+
if ( $warnings )
{
mtr_report("[ fail ] Found warnings in server log file!");
+ mtr_report(" Test ended at $timest");
mtr_report($warnings);
return;
}
my $timeout= $tinfo->{'timeout'};
if ( $timeout )
{
- mtr_report("[ fail ] timeout after $timeout minutes");
+ mtr_report("[ fail ] timeout after $timeout seconds");
+ mtr_report(" Test ended at $timest");
mtr_report("\n$tinfo->{'comment'}");
return;
}
else
{
- mtr_report("[ fail ]");
+ mtr_report("[ fail ]\n Test ended at $timest");
}
if ( $logfile )
@@ -372,6 +376,13 @@
use Time::HiRes qw(gettimeofday);
+sub format_time {
+ my $tm= localtime();
+ return sprintf("%4d-%02d-%02d %02d:%02d:%02d",
+ $tm->year + 1900, $tm->mon+1, $tm->mday,
+ $tm->hour, $tm->min, $tm->sec);
+}
+
my $t0= gettimeofday();
sub _timestamp {
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (Bjorn.Munch:2704) Bug#40924 | Bjorn Munch | 3 Dec |