summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafal Somla <Rafal.Somla@sun.com>2009-02-13 16:27:33 +0100
committerRafal Somla <Rafal.Somla@sun.com>2009-02-13 16:27:33 +0100
commitbdbe393db1b55cbde9aa4ca66cc551b57dad7f1f (patch)
tree14250666294c2f2bd6d4d354481e27ae728c8658
parent05b6c2713edd1a37383ac8168130385d109769c7 (diff)
downloadmariadb-git-bdbe393db1b55cbde9aa4ca66cc551b57dad7f1f.tar.gz
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. 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
-rw-r--r--client/mysqltest.cc14
-rwxr-xr-xmysql-test/mysql-test-run.pl15
2 files changed, 19 insertions, 10 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 89b9c78a049..e9e462b8d3f 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -4647,6 +4647,10 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
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))
{
@@ -4678,6 +4682,7 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
}
failed_attempts++;
}
+ verbose_msg("... Connected.");
DBUG_VOID_RETURN;
}
@@ -7511,8 +7516,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);
@@ -7521,6 +7530,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))
@@ -7591,6 +7602,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;
@@ -7908,6 +7920,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");
@@ -7958,6 +7971,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);
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index f8f9b89d141..50617428d0f 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2874,9 +2874,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");
@@ -3494,6 +3491,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 )
{
@@ -3583,10 +3581,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
@@ -3608,8 +3605,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 ".
@@ -4493,6 +4488,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" )
{
@@ -4662,8 +4658,7 @@ sub start_mysqltest ($) {
elsif ( $opt_client_debugger )
{
debugger_arguments(\$args, \$exe, "client");
- }
-
+ }
my $proc= My::SafeProcess->new
(