From b0a74097f1c6bddb5229f19bc0214b86684b1f6d Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 24 May 2011 10:54:34 +0200 Subject: [PATCH 1/5] Bug#11831031: MTR SHOULD FIND TEST SUITES FROM FEATURE TREES OUTSIDE MYSQL-TEST Backported from trunk-mtr --- mysql-test/lib/mtr_cases.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index c3dd43c12ca..d677645d9da 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -287,9 +287,11 @@ sub collect_one_suite($) "mysql-test/suite", "mysql-test", # Look in storage engine specific suite dirs - "storage/*/mysql-test-suites" + "storage/*/mtr", + # Look in plugin specific suite dir + "plugin/$suite/tests", ], - [$suite]); + [$suite, "mtr"]); } mtr_verbose("suitedir: $suitedir"); } From d7334d8d859b787bfb4a3dd508618675dd2d85d9 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 25 May 2011 10:58:33 +0200 Subject: [PATCH 2/5] Bug #11750043 40340: USE GZIPPED CORE FILES TO SAVE SPACE Use [g]zip on core file if available, ignore if not Skip if running named test, and print a line saying what it compressed. --- mysql-test/lib/mtr_misc.pl | 35 +++++++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.pl | 2 ++ 2 files changed, 37 insertions(+) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index a7b5afd9fd7..e50e8cc77df 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -31,6 +31,7 @@ sub mtr_script_exists(@); sub mtr_file_exists(@); sub mtr_exe_exists(@); sub mtr_exe_maybe_exists(@); +sub mtr_compress_file($); sub mtr_milli_sleep($); sub start_timer($); sub has_expired($); @@ -199,6 +200,40 @@ sub mtr_exe_exists (@) { } } +# +# Try to compress file using tools that might be available. +# If zip/gzip is not available, just silently ignore. +# + +sub mtr_compress_file ($) { + my ($filename)= @_; + + mtr_error ("File to compress not found: $filename") unless -f $filename; + + my $did_compress= 0; + + if (IS_WINDOWS) + { + # Capture stderr + my $ziperr= `zip $filename.zip $filename 2>&1`; + if ($?) { + print "$ziperr\n" if $ziperr !~ /recognized as an internal or external/; + } else { + unlink($filename); + $did_compress=1; + } + } + else + { + my $gzres= system("gzip $filename"); + $did_compress= ! $gzres; + if ($gzres && $gzres != -1) { + mtr_error ("Error: have gzip but it fails to compress core file"); + } + } + mtr_print("Compressed file $filename") if $did_compress; +} + sub mtr_milli_sleep ($) { die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0e4b3cedbfd..067c83a6f51 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -657,6 +657,8 @@ sub run_test_server ($$$) { mtr_report(" - deleting it, already saved", "$opt_max_save_core"); unlink("$core_file"); + } else { + mtr_compress_file($core_file) unless @opt_cases; } ++$num_saved_cores; } From eb8586236662b6715a0fd852286ab0d1c56ad90b Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 25 May 2011 12:39:11 +0200 Subject: [PATCH 3/5] Bug #12586211 ENABLE GCOV BUILDS WITH CMAKE, INCLUDING PLUGINS Added --with-gcov option to configure.pl and use that from SETUP.sh --- BUILD/SETUP.sh | 4 ++-- cmake/configure.pl | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index c7f434d1bb3..00bd4965f87 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2000, 2007 MySQL AB +# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -250,7 +250,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" gcov_link_flags="-fprofile-arcs -ftest-coverage" -gcov_configs="--disable-shared" +gcov_configs="--with-gcov" # gprof diff --git a/cmake/configure.pl b/cmake/configure.pl index b24afa034c7..bf872264953 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -190,6 +190,11 @@ foreach my $option (@ARGV) $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; next; } + if ($option =~ /with-gcov/) + { + $cmakeargs = $cmakeargs." -DENABLE_GCOV=ON"; + next; + } $option = uc($option); $option =~ s/-/_/g; From 850b27ccdb0f0337ca06c39dc81f09a2da6da9e7 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 25 May 2011 16:07:16 +0200 Subject: [PATCH 4/5] Bug #12590770 TEST SPECIFIC TIMEOUT SETTING DOES NOT APPLY TO "CHECK" OR "WARNINGS" Replace global check_timeout with one that calls testcase_timeout for the test --- mysql-test/mysql-test-run.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 067c83a6f51..42360aeb28f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -263,7 +263,6 @@ my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds sub suite_timeout { return $opt_suite_timeout * 60; }; -sub check_timeout { return $opt_testcase_timeout * 6; }; my $opt_wait_all; my $opt_user_args; @@ -299,6 +298,8 @@ sub testcase_timeout ($) { return $opt_testcase_timeout * 60; } +sub check_timeout ($) { return testcase_timeout($_[0]) / 10; } + our $opt_warnings= 1; our $opt_include_ndbcluster= 0; @@ -3415,7 +3416,7 @@ sub check_testcase($$) # Return immediately if no check proceess was started return 0 unless ( keys %started ); - my $timeout= start_timer(check_timeout()); + my $timeout= start_timer(check_timeout($tinfo)); while (1){ my $result; @@ -3487,7 +3488,7 @@ test case was executed:\n"; } elsif ( $proc->{timeout} ) { $tinfo->{comment}.= "Timeout for 'check-testcase' expired after " - .check_timeout()." seconds"; + .check_timeout($tinfo)." seconds"; $result= 4; } else { @@ -3577,7 +3578,7 @@ sub run_on_all($$) # Return immediately if no check proceess was started return 0 unless ( keys %started ); - my $timeout= start_timer(check_timeout()); + my $timeout= start_timer(check_timeout($tinfo)); while (1){ my $result; @@ -3608,7 +3609,7 @@ sub run_on_all($$) } elsif ($proc->{timeout}) { $tinfo->{comment}.= "Timeout for '$run' expired after " - .check_timeout()." seconds"; + .check_timeout($tinfo)." seconds"; } else { # Unknown process returned, most likley a crash, abort everything @@ -4333,7 +4334,7 @@ sub check_warnings ($) { # Return immediately if no check proceess was started return 0 unless ( keys %started ); - my $timeout= start_timer(check_timeout()); + my $timeout= start_timer(check_timeout($tinfo)); while (1){ my $result= 0; @@ -4385,7 +4386,7 @@ sub check_warnings ($) { } elsif ( $proc->{timeout} ) { $tinfo->{comment}.= "Timeout for 'check warnings' expired after " - .check_timeout()." seconds"; + .check_timeout($tinfo)." seconds"; $result= 4; } else { From e75292dbeea23601d294bd166cca3e324dce4fff Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 25 May 2011 16:39:39 +0200 Subject: [PATCH 5/5] Increase test timeout for rpl.rpl_typeconv Not for test itself but because it procuces large number of warnings, and this may take >90s to filter on slow boxes --- mysql-test/suite/rpl/t/rpl_typeconv-master.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/rpl/t/rpl_typeconv-master.opt diff --git a/mysql-test/suite/rpl/t/rpl_typeconv-master.opt b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt new file mode 100644 index 00000000000..de048691031 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt @@ -0,0 +1 @@ +--testcase-timeout=40