#At file:///ext/mysql/bzr/backup/mtr-extend-6.0/
3037 Rafal Somla 2009-02-13
Modifications to MTR and mysqltest to improve feedback from the latter when
testcase checks are made.
MTR spawns mysqltest to run check-testcase test before and after each testcase
it runs. It can also run check-warnings using mysqltest. Since it happened on PB
that these checks hanged, this patch provides additional feedback to help
investigating such failures:
- mysqltest is modified to give feedback about main steps in execution of a
testcase if run in verbose mode (including connection to the server),
- MTR is modified to run mysqltest in verbose mode when doing check-testcase or
check-warnings. The diagnostic output from mysqltest is preserved so that it is
saved upon test failure.
modified:
client/mysqltest.cc
mysql-test/mysql-test-run.pl
per-file messages:
client/mysqltest.cc
Add verbose messages informing about main steps in execution of a testcase.
mysql-test/mysql-test-run.pl
- When doing check-testcase or check-warnings run mysqltest in verbose mode.
- Do not delete the mysqltest's error log if errors are detected during these
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2009-02-12 17:56:03 +0000
+++ b/client/mysqltest.cc 2009-02-13 12:51:44 +0000
@@ -4674,6 +4674,10 @@ void safe_connect(MYSQL* mysql, const ch
int failed_attempts= 0;
DBUG_ENTER("safe_connect");
+
+ verbose_msg("Connecting to server %s:%d (socket %s) as '%s'"
+ ", connection '%s', attempt %d ...",
+ host, port, sock, user, name, failed_attempts);
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
{
@@ -4705,6 +4709,7 @@ void safe_connect(MYSQL* mysql, const ch
}
failed_attempts++;
}
+ verbose_msg("... Connected.");
DBUG_VOID_RETURN;
}
@@ -7561,8 +7566,12 @@ int main(int argc, char **argv)
parse_args(argc, argv);
log_file.open(opt_logdir, result_file_name, ".log");
+ verbose_msg("Logging to '%s'.", log_file.file_name());
if (opt_mark_progress)
+ {
progress_file.open(opt_logdir, result_file_name, ".progress");
+ verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
+ }
var_set_int("$PS_PROTOCOL", ps_protocol);
var_set_int("$SP_PROTOCOL", sp_protocol);
@@ -7571,6 +7580,8 @@ int main(int argc, char **argv)
DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : ""));
+ verbose_msg("Results saved in '%s'.",
+ result_file_name ? result_file_name : "");
if (mysql_server_init(embedded_server_arg_count,
embedded_server_args,
(char**) embedded_server_groups))
@@ -7641,6 +7652,7 @@ int main(int argc, char **argv)
open_file(opt_include);
}
+ verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);
while (!read_command(&command) && !abort_flag)
{
int current_line_inc = 1, processed = 0;
@@ -7985,6 +7997,7 @@ int main(int argc, char **argv)
log_file.close();
start_lineno= 0;
+ verbose_msg("... Done processing test commands.");
if (parsing_disabled)
die("Test ended with parsing disabled");
@@ -8035,6 +8048,7 @@ int main(int argc, char **argv)
if (!command_executed && result_file_name)
die("No queries executed but result file found!");
+ verbose_msg("Test has succeeded!");
timer_output();
/* Yes, if we got this far the test has suceeded! Sakila smiles */
cleanup_and_exit(0);
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2009-02-12 17:56:03 +0000
+++ b/mysql-test/mysql-test-run.pl 2009-02-13 12:51:44 +0000
@@ -2912,9 +2912,6 @@ test case was executed:\n";
$result= 2;
}
- # Remove the .err file the check generated
- unlink($err_file);
-
# Remove the .result file the check generated
unlink("$base_file.result");
@@ -3533,6 +3530,7 @@ sub start_check_warnings ($$) {
mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test");
+ mtr_add_arg($args, "--verbose");
if ( $opt_embedded_server )
{
@@ -3622,10 +3620,9 @@ sub check_warnings ($) {
if ( $res == 62 ) {
# Test case was ok and called "skip"
- ;
+ # Remove the .err file the check generated
+ unlink($err_file);
}
- # Remove the .err file the check generated
- unlink($err_file);
if ( keys(%started) == 0){
# All checks completed
@@ -3647,8 +3644,6 @@ sub check_warnings ($) {
$result= 2;
}
- # Remove the .err file the check generated
- unlink($err_file);
}
elsif ( $proc eq $timeout_proc ) {
$tinfo->{comment}.= "Timeout $timeout_proc for ".
@@ -4547,6 +4542,7 @@ sub start_check_testcase ($$$) {
mtr_add_arg($args, "--result-file=%s", "$opt_vardir/tmp/$name.result");
mtr_add_arg($args, "--test-file=%s", "include/check-testcase.test");
+ mtr_add_arg($args, "--verbose");
if ( $mode eq "before" )
{
@@ -4721,8 +4717,7 @@ sub start_mysqltest ($) {
elsif ( $opt_client_debugger )
{
debugger_arguments(\$args, \$exe, "client");
- }
-
+ }
my $proc= My::SafeProcess->new
(
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (Rafal.Somla:3037) | Rafal Somla | 13 Feb |