mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
cf9038e979
fails randomly. The problem was that the test case used command line tool (mysql) without specifying connect_timeout argument. In some cases, this lead to hanging of the test case. The fix is to specify --connect_timeout=1 when starting mysql. Also, the patch contains polishing and various cleanups to simplify analyzing of the problems further. The patch affects only test suite, no server codebase has been touched. mysql-test/lib/mtr_im.pl: Remember PID of the IM-spawner -- a process, that is used to fork IM-angel. mysql-test/lib/mtr_io.pl: Trim \n from the PID. mysql-test/lib/mtr_process.pl: Don't complain if it was IM-spawner, who died. mysql-test/r/im_daemon_life_cycle.result: Update the result file. mysql-test/r/im_life_cycle.result: Update the result file. mysql-test/t/im_daemon_life_cycle.imtest: Polishing: add more comments, be more verbose. mysql-test/t/im_life_cycle.imtest: Polishing: be more verbose. mysql-test/t/im_utils.imtest: Polishing: be more verbose. mysql-test/t/kill_n_check.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/wait_for_process.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/wait_for_socket.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/log.sh: Dummy script to facilitate logging from test-scripts. mysql-test/t/utils.sh: A bunch of auxilary functions to facilitate logging.
55 lines
1.1 KiB
Bash
55 lines
1.1 KiB
Bash
###########################################################################
|
|
#
|
|
# This file provides utility functions and is included by other scripts.
|
|
#
|
|
# The following global variables must be set before calling functions from this
|
|
# file:
|
|
# - basename -- base name of the calling script (main application);
|
|
# - log_file -- where to store log records;
|
|
#
|
|
###########################################################################
|
|
|
|
log()
|
|
{
|
|
[ -z "$log_file" ] && return;
|
|
|
|
log_level="$1"
|
|
log_msg="$2"
|
|
ts=`date`
|
|
|
|
echo "[$ts] [$basename] [$log_level] $log_msg" >> "$log_file";
|
|
}
|
|
|
|
###########################################################################
|
|
|
|
log_debug()
|
|
{
|
|
log 'DEBUG' "$1"
|
|
}
|
|
|
|
###########################################################################
|
|
|
|
log_info()
|
|
{
|
|
log 'INFO' "$1"
|
|
echo "$1"
|
|
}
|
|
|
|
###########################################################################
|
|
|
|
log_error()
|
|
{
|
|
log 'ERROR' "$1"
|
|
echo "Error: $1"
|
|
}
|
|
|
|
###########################################################################
|
|
|
|
quit()
|
|
{
|
|
exit_status="$1"
|
|
|
|
log_debug "-- $basename: finished (exit_status: $exit_status) --"
|
|
|
|
exit $exit_status
|
|
}
|