mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Print tests that has been run but shouldn't and vice versa
Use opt_start_timeout also for ndb Remove the .result files generated by 'check_testcase'
This commit is contained in:
@ -131,8 +131,6 @@ sub mtr_report_test ($) {
|
|||||||
|
|
||||||
if ($tinfo->{'result'} eq 'MTR_RES_FAILED'){
|
if ($tinfo->{'result'} eq 'MTR_RES_FAILED'){
|
||||||
|
|
||||||
#my $test_failures= $tinfo->{'failures'} || 0;
|
|
||||||
#$tinfo->{'failures'}= $test_failures + 1;
|
|
||||||
if ( defined $tinfo->{'warnings'} )
|
if ( defined $tinfo->{'warnings'} )
|
||||||
{
|
{
|
||||||
mtr_report("[ fail ] Found warnings in server log file!");
|
mtr_report("[ fail ] Found warnings in server log file!");
|
||||||
@ -233,7 +231,7 @@ sub mtr_report_stats ($) {
|
|||||||
$tot_tests++;
|
$tot_tests++;
|
||||||
$tot_passed++;
|
$tot_passed++;
|
||||||
}
|
}
|
||||||
elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' )
|
elsif ( $tinfo->{failures} )
|
||||||
{
|
{
|
||||||
$tot_tests++;
|
$tot_tests++;
|
||||||
$tot_failed++;
|
$tot_failed++;
|
||||||
@ -301,6 +299,14 @@ sub mtr_report_stats ($) {
|
|||||||
# Print a list of testcases that failed
|
# Print a list of testcases that failed
|
||||||
if ( $tot_failed != 0 )
|
if ( $tot_failed != 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
# Print each failed test, again
|
||||||
|
#foreach my $test ( @$tests ){
|
||||||
|
# if ( $test->{result} eq 'MTR_RES_FAILED' ) {
|
||||||
|
# mtr_report_test($test);
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
|
||||||
my $ratio= $tot_passed * 100 / $tot_tests;
|
my $ratio= $tot_passed * 100 / $tot_tests;
|
||||||
print "Failed $tot_failed/$tot_tests tests, ";
|
print "Failed $tot_failed/$tot_tests tests, ";
|
||||||
printf("%.2f", $ratio);
|
printf("%.2f", $ratio);
|
||||||
|
@ -322,15 +322,29 @@ sub main {
|
|||||||
if ( @$completed != $num_tests){
|
if ( @$completed != $num_tests){
|
||||||
|
|
||||||
if ($opt_force){
|
if ($opt_force){
|
||||||
# All test should have been run, print the completed list
|
# All test should have been run, print the ones that differs
|
||||||
foreach my $test ( @$completed ){
|
my %tests= ();
|
||||||
$test->print_test();
|
foreach my $t (@$tests) { $tests{$t->key()}= 1; };
|
||||||
|
foreach my $done ( @$completed ){
|
||||||
|
if ($tests{$done->key()}) {
|
||||||
|
mtr_report("Found one extra completed");
|
||||||
|
$done->print_test();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
%tests= ();
|
||||||
|
foreach my $t (@$completed) { $tests{$t->key()}= 1; };
|
||||||
|
foreach my $done ( @$tests ){
|
||||||
|
if ($tests{$done->key()}) {
|
||||||
|
mtr_report("Found one test not run");
|
||||||
|
$done->print_test();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Not all tests completed, failure
|
# Not all tests completed, failure
|
||||||
mtr_report();
|
mtr_report();
|
||||||
mtr_report("After @$completed of $num_tests.");
|
mtr_report(@$completed, " of $num_tests completed.");
|
||||||
mtr_error("Test failed.",
|
mtr_error("Test failed.",
|
||||||
"To continue, re-run with '--force'");
|
"To continue, re-run with '--force'");
|
||||||
}
|
}
|
||||||
@ -467,6 +481,7 @@ sub run_test_server {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
|
mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
|
||||||
|
delete($result->{result});
|
||||||
$result->{retries}= $retries+1;
|
$result->{retries}= $retries+1;
|
||||||
$result->write_test($sock, 'TESTCASE');
|
$result->write_test($sock, 'TESTCASE');
|
||||||
next;
|
next;
|
||||||
@ -479,7 +494,7 @@ sub run_test_server {
|
|||||||
{
|
{
|
||||||
$result->{retries}= 0;
|
$result->{retries}= 0;
|
||||||
$result->{failures}= 0;
|
$result->{failures}= 0;
|
||||||
|
delete($result->{result});
|
||||||
$result->{repeat}= $repeat+1;
|
$result->{repeat}= $repeat+1;
|
||||||
$result->write_test($sock, 'TESTCASE');
|
$result->write_test($sock, 'TESTCASE');
|
||||||
next;
|
next;
|
||||||
@ -1983,7 +1998,7 @@ sub ndbcluster_wait_started($$){
|
|||||||
mtr_init_args(\$args);
|
mtr_init_args(\$args);
|
||||||
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
|
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
|
||||||
mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
|
mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
|
||||||
mtr_add_arg($args, "--timeout=60");
|
mtr_add_arg($args, "--timeout=%d", $opt_start_timeout);
|
||||||
|
|
||||||
if ($ndb_waiter_extra_opt)
|
if ($ndb_waiter_extra_opt)
|
||||||
{
|
{
|
||||||
@ -2600,7 +2615,6 @@ sub check_testcase($$)
|
|||||||
|
|
||||||
my $err_file= $proc->user_data();
|
my $err_file= $proc->user_data();
|
||||||
my $base_file= mtr_match_extension($err_file, "err"); # Trim extension
|
my $base_file= mtr_match_extension($err_file, "err"); # Trim extension
|
||||||
unlink("$base_file.result");
|
|
||||||
|
|
||||||
# One check testcase process returned
|
# One check testcase process returned
|
||||||
my $res= $proc->exit_status();
|
my $res= $proc->exit_status();
|
||||||
@ -2611,6 +2625,11 @@ sub check_testcase($$)
|
|||||||
# Remove the .err file the check generated
|
# Remove the .err file the check generated
|
||||||
unlink($err_file);
|
unlink($err_file);
|
||||||
|
|
||||||
|
# Remove the .result file the check generated
|
||||||
|
if ( $mode eq 'after' ){
|
||||||
|
unlink("$base_file.result");
|
||||||
|
}
|
||||||
|
|
||||||
if ( keys(%started) == 0){
|
if ( keys(%started) == 0){
|
||||||
# All checks completed
|
# All checks completed
|
||||||
return 0;
|
return 0;
|
||||||
@ -2646,6 +2665,9 @@ sub check_testcase($$)
|
|||||||
# Remove the .err file the check generated
|
# Remove the .err file the check generated
|
||||||
unlink($err_file);
|
unlink($err_file);
|
||||||
|
|
||||||
|
# Remove the .result file the check generated
|
||||||
|
unlink("$base_file.result");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user