@@ -107,12 +107,6 @@ verify_master_and_replica() {
107107 fi
108108}
109109
110- exec_cmd () {
111- echo " $@ "
112- command " $@ " 1> $test_logfile 2>&1
113- return $?
114- }
115-
116110echo_dot () {
117111 echo -n " ."
118112}
@@ -225,7 +219,7 @@ test_single() {
225219 cat $tests_path /$test_name /create.sql
226220 return 1
227221 fi
228-
222+
229223 if [ -f $tests_path /$test_name /before.sql ]; then
230224 gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path /$test_name /before.sql
231225 gh-ost-test-mysql-replica --default-character-set=utf8mb4 test < $tests_path /$test_name /before.sql
@@ -310,7 +304,7 @@ test_single() {
310304 echo_dot
311305 echo $cmd > $exec_command_file
312306 echo_dot
313- bash $exec_command_file 1 >$test_logfile 2>&1
307+ bash $exec_command_file > $test_logfile 2>&1
314308
315309 execution_result=$?
316310 cleanup
@@ -332,7 +326,10 @@ test_single() {
332326 if [ -f $tests_path /$test_name /expect_failure ]; then
333327 if [ $execution_result -eq 0 ]; then
334328 echo
335- echo " ERROR $test_name execution was expected to exit on error but did not. cat $test_logfile "
329+ echo " ERROR $test_name execution was expected to exit on error but did not."
330+ echo " === Last 50 lines of $test_logfile ==="
331+ tail -n 50 $test_logfile
332+ echo " === End log excerpt ==="
336333 return 1
337334 fi
338335 if [ -s $tests_path /$test_name /expect_failure ]; then
@@ -342,7 +339,10 @@ test_single() {
342339 return 0
343340 fi
344341 echo
345- echo " ERROR $test_name execution was expected to exit with error message '${expected_error_message} ' but did not. cat $test_logfile "
342+ echo " ERROR $test_name execution was expected to exit with error message '${expected_error_message} ' but did not."
343+ echo " === Last 50 lines of $test_logfile ==="
344+ tail -n 50 $test_logfile
345+ echo " === End log excerpt ==="
346346 return 1
347347 fi
348348 # 'expect_failure' file has no content. We generally agree that the failure is correct
0 commit comments