Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2e889de3
Commit
2e889de3
authored
Apr 05, 2017
by
Sachin Setiya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test cases in galera suite
Signed-off-by:
Sachin Setiya
<
sachin.setiya@mariadb.com
>
parent
969fc611
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
160 additions
and
4 deletions
+160
-4
mysql-test/include/assert_grep.inc
mysql-test/include/assert_grep.inc
+154
-0
mysql-test/suite/galera/r/GAL-401.result
mysql-test/suite/galera/r/GAL-401.result
+1
-2
mysql-test/suite/galera/r/lp1376747-4.result
mysql-test/suite/galera/r/lp1376747-4.result
+4
-0
mysql-test/suite/galera/t/GAL-401.test
mysql-test/suite/galera/t/GAL-401.test
+1
-2
No files found.
mysql-test/include/assert_grep.inc
0 → 100644
View file @
2e889de3
# ==== Purpose ====
#
# Grep a file for a pattern, produce a single string out of the
# matching lines, and assert that the string matches a given regular
# expression.
#
# ==== Usage ====
#
# --let $assert_text= TEXT
# --let $assert_file= FILE
# --let $assert_select= REGEX
# [--let $assert_match= REGEX | --let $assert_count= NUMBER]
# [--let $assert_only_after= REGEX]
# --source include/assert_grep.inc
#
# Parameters:
#
# $assert_text
# Text that describes what is being checked. This text is written to
# the query log so it should not contain non-deterministic elements.
#
# $assert_file
# File to search.
#
# $assert_select
# All lines matching this text will be checked.
#
# $assert_match
# The script will find all lines that match $assert_select,
# concatenate them to a long string, and assert that it matches
# $assert_match.
#
# $assert_count
# Instead of asserting that the selected lines match
# $assert_match, assert that there were exactly $assert_count
# matching lines.
#
# $assert_only_after
# Reset all the lines matched and the counter when finding this pattern.
# It is useful for searching things in the mysqld.err log file just
# after the last server restart for example (discarding the log content
# of previous server executions).
if
(
!
$assert_text
)
{
--
die
!!!
ERROR
IN
TEST
:
you
must
set
$assert_text
}
if
(
!
$assert_file
)
{
--
die
!!!
ERROR
IN
TEST
:
you
must
set
$assert_file
}
if
(
!
$assert_select
)
{
--
die
!!!
ERROR
IN
TEST
:
you
must
set
$assert_select
}
if
(
$assert_match
==
''
)
{
if
(
$assert_count
==
''
)
{
--
die
!!!
ERROR
IN
TEST
:
you
must
set
either
$assert_match
or
$assert_count
}
}
if
(
$assert_match
!=
''
)
{
if
(
$assert_count
!=
''
)
{
--
echo
assert_text
=
'$assert_text'
assert_count
=
'$assert_count'
--
die
!!!
ERROR
IN
TEST
:
you
must
set
only
one
of
$assert_match
or
$assert_count
}
}
--
let
$include_filename
=
assert_grep
.
inc
[
$assert_text
]
--
source
include
/
begin_include_file
.
inc
--
let
_AG_ASSERT_TEXT
=
$assert_text
--
let
_AG_ASSERT_FILE
=
$assert_file
--
let
_AG_ASSERT_SELECT
=
$assert_select
--
let
_AG_ASSERT_MATCH
=
$assert_match
--
let
_AG_ASSERT_COUNT
=
$assert_count
--
let
_AG_OUT
=
`SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_ag_', UUID())`
--
let
_AG_ASSERT_ONLY_AFTER
=
$assert_only_after
--
perl
use
strict
;
use
warnings
;
my
$file
=
$ENV
{
'_AG_ASSERT_FILE'
};
my
$assert_select
=
$ENV
{
'_AG_ASSERT_SELECT'
};
my
$assert_match
=
$ENV
{
'_AG_ASSERT_MATCH'
};
my
$assert_count
=
$ENV
{
'_AG_ASSERT_COUNT'
};
my
$assert_only_after
=
$ENV
{
'_AG_ASSERT_ONLY_AFTER'
};
my
$out
=
$ENV
{
'_AG_OUT'
};
my
$result
=
''
;
my
$count
=
0
;
open
(
FILE
,
"
$file
"
)
or
die
(
"Error $? opening
$file
: $!
\n
"
);
while
(
<
FILE
>
)
{
my
$line
=
$_
;
if
(
$assert_only_after
&&
$line
=~
/
$assert_only_after
/
)
{
$result
=
""
;
$count
=
0
;
}
if
(
$line
=~
/
$assert_select
/
)
{
if
(
$assert_count
ne
''
)
{
$count
++
;
}
else
{
$result
.=
$line
;
}
}
}
close
(
FILE
)
or
die
(
"Error $? closing
$file
: $!"
);
open
OUT
,
">
$out
"
or
die
(
"Error $? opening
$out
: $!"
);
if
(
$assert_count
ne
''
&&
(
$count
!=
$assert_count
))
{
print
OUT
(
$count
)
or
die
(
"Error $? writing
$out
: $!"
);
}
elsif
(
$assert_count
eq
''
&&
$result
!~
/
$assert_match
/
)
{
print
OUT
(
$result
)
or
die
(
"Error $? writing
$out
: $!"
);
}
else
{
print
OUT
(
"assert_grep.inc ok"
);
}
close
OUT
or
die
(
"Error $? closing
$out
: $!"
);
EOF
--
let
$_ag_outcome
=
`SELECT LOAD_FILE('$_AG_OUT')`
if
(
$_ag_outcome
!=
'assert_grep.inc ok'
)
{
--
source
include
/
show_rpl_debug_info
.
inc
--
echo
include
/
assert_grep
.
inc
failed
!
--
echo
assert_text
:
'$assert_text'
--
echo
assert_file
:
'$assert_file'
--
echo
assert_select
:
'$assert_select'
--
echo
assert_match
:
'$assert_match'
--
echo
assert_count
:
'$assert_count'
--
echo
assert_only_after
:
'$assert_only_after'
if
(
$assert_match
!=
''
)
{
--
echo
matching
lines
:
'$_ag_outcome'
}
if
(
$assert_count
!=
''
)
{
--
echo
number
of
matching
lines
:
$_ag_outcome
}
--
die
assert_grep
.
inc
failed
.
}
--
let
$include_filename
=
include
/
assert_grep
.
inc
[
$assert_text
]
--
source
include
/
end_include_file
.
inc
mysql-test/suite/galera/r/GAL-401.result
View file @
2e889de3
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
SET @@global.wsrep_desync = 1;
SET SESSION wsrep_
sync_wait=0
;
SET SESSION wsrep_
dirty_reads=1
;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
...
...
@@ -8,7 +8,6 @@ SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET @@global.wsrep_desync = 0;
SET SESSION wsrep_sync_wait=7;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
mysql-test/suite/galera/r/lp1376747-4.result
View file @
2e889de3
...
...
@@ -2,11 +2,15 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
FLUSH TABLE WITH READ LOCK;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
mysql-test/suite/galera/t/GAL-401.test
View file @
2e889de3
...
...
@@ -9,7 +9,7 @@ SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
# Desync and disconnect node 2 from the PC:
--
connection
node_2
SET
@@
global
.
wsrep_desync
=
1
;
SET
SESSION
wsrep_
sync_wait
=
0
;
SET
SESSION
wsrep_
dirty_reads
=
1
;
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate=1'
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
'non-Primary'
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_status'
;
--
source
include
/
wait_condition
.
inc
...
...
@@ -41,7 +41,6 @@ SET @@global.wsrep_desync = 0;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
'Synced'
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_local_state_comment'
;
--
source
include
/
wait_condition
.
inc
SET
SESSION
wsrep_sync_wait
=
7
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CALL
mtr
.
add_suppression
(
"WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer
\\
(SYNCED
\\
). Message ignored."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment