Merge pull request #341 from percona/PT-1554-ps5.6

PT-1554 Updated tests for MySQL 5.6
This commit is contained in:
Carlos Salguero
2018-05-30 00:32:55 -03:00
committed by GitHub
8 changed files with 26 additions and 15 deletions

View File

@@ -122,8 +122,12 @@ make_sandbox() {
fi
if [ -n "$GTID" ]; then
#echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
echo "gtid_mode=ON_PERMISSIVE" >> ${TMP_DIR}/$port/my.sandbox.cnf
if [ "$version" "<" '5.7' ]; then
echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
fi
if [ ! "$version" "<" '5.7' ]; then
echo "gtid_mode=ON_PERMISSIVE" >> ${TMP_DIR}/$port/my.sandbox.cnf
fi
echo "enforce_gtid_consistency" >> ${TMP_DIR}/$port/my.sandbox.cnf
fi
if [ -n "$REPLICATION_THREADS" ]; then
@@ -143,7 +147,7 @@ make_sandbox() {
if [ $generating_database -eq 1 ]; then
echo "Creating default databases ..."
if [ "$version" > "5.6" ]; then
if [ "$version" ">" "5.6" ]; then
rm -f ${TMP_DIR}/empty-defaults.txt
touch ${TMP_DIR}/empty-defaults.txt
rm -rf ${TMP_DIR}/$port/data

View File

@@ -21,8 +21,10 @@ use Sandbox;
use SqlModes;
use File::Temp qw/ tempdir /;
if (!$ENV{PERCONA_SLOW_BOX}) {
if ($ENV{PERCONA_SLOW_BOX}) {
plan skip_all => 'This test needs a fast machine';
} elsif ($sandbox_version lt '5.7') {
plan skip_all => 'This tests needs MySQL 5.7+';
} else {
plan tests => 3;
}

View File

@@ -21,7 +21,11 @@ use Sandbox;
use SqlModes;
use File::Temp qw/ tempdir /;
plan tests => 4;
if ($sandbox_version lt '5.7') {
plan skip_all => 'This test needs MySQL 5.7+';
} else {
plan tests => 4;
}
require "$trunk/bin/pt-online-schema-change";
@@ -60,7 +64,7 @@ $dbh3->do("FLUSH TABLES");
my $new_dir='/tmp/tdir';
diag(`rm -rf $new_dir`);
diag(`mkdir $new_dir`);
diag(`mkdir -p $new_dir`);
diag("2");
($output, $exit_status) = full_output(
@@ -87,7 +91,7 @@ like(
);
my $db_dir="$new_dir/test/";
my $db_dir="$new_dir";
opendir(my $dh, $db_dir) || die "Can't opendir $db_dir: $!";
my @files = grep { /^t3#P#p/ } readdir($dh);
closedir $dh;

View File

@@ -1,10 +1,10 @@
# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ================== ============= ===== ====== ===== ========
# 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 0.00 SELECT t
# Rank Query ID Response time Calls R/Call V/M
# ==== ================================== ============= ===== ====== =====
# 1 0x867E8F0D95B72228D4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 0.00 SELECT t
# Query 1: 0 QPS, 0x concurrency, ID 0xD4B6A5CD2F2F485C at byte 0 ________
# Query 1: 0 QPS, 0x concurrency, ID 0x867E8F0D95B72228D4B6A5CD2F2F485C at byte 0
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: all events occurred at 2010-12-14 16:12:28

View File

@@ -1,5 +1,5 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x8E306CDB7A800841 at byte 0 ________
# Query 1: 0 QPS, 0x concurrency, ID 0x88F3D65BE48113F18E306CDB7A800841 at byte 0
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: all events occurred at 2007-12-18 11:48:27

View File

@@ -1,5 +1,5 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x8E306CDB7A800841 at byte 0 ________
# Query 1: 0 QPS, 0x concurrency, ID 0x88F3D65BE48113F18E306CDB7A800841 at byte 0
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: all events occurred at 2007-12-18 11:48:27

View File

@@ -69,8 +69,7 @@ $slave2_dbh->do('RESET SLAVE');
$slave2_dbh->do('START SLAVE');
# 3
# $output = `$trunk/bin/pt-slave-delay --delay 1s h=127.1,P=12346,u=msandbox,p=msandbox h=127.1 2>&1`;
$output = `$trunk/bin/pt-slave-delay --delay 1s h=127.1,P=12346,u=msandbox,p=msandbox h=127.1 &>/tmp/c`;
$output = `$trunk/bin/pt-slave-delay --delay 1s h=127.1,P=12346,u=msandbox,p=msandbox h=127.1 2>&1`;
like(
$output,
qr/Binary logging is disabled/,

View File

@@ -19,7 +19,9 @@ if ( $sandbox_version lt '5.6' ) {
plan skip_all => "Requires MySQL 5.6";
}
diag('Restarting the sandbox');
diag(`SAKILA=0 GTID=1 $trunk/sandbox/test-env restart`);
diag("Sandbox restarted");
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);