Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

test: fix a unstable integration test #426

Merged
merged 1 commit into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/_utils/run_services
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stop_services() {
killall -9 tikv-importer || true
killall -9 tiflash || true

find "$TEST_DIR" -maxdepth 1 -not -path "$TEST_DIR" -not -name "cov.*" -not -name "*.log" | xargs rm -r || true
find "$TEST_DIR" -maxdepth 1 -not -path "$TEST_DIR" -not -name "cov.*" -not -name "*.log" | xargs rm -rf || true
}

start_services() {
Expand Down
9 changes: 8 additions & 1 deletion tests/row-format-v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

set -eux

run_sql 'show variables like "%tidb_row_format_version%";'
row_format=$(grep 'Value: [0-9]' "$TEST_DIR/sql_res.$TEST_NAME.txt" | awk '{print $2}')

if [ "$row_format" -ne "2" ]; then
run_sql 'SET @@global.tidb_row_format_version = 2;' || { echo 'TiDB does not support changing row format version! skipping test'; exit 0; }
fi

run_sql 'DROP DATABASE IF EXISTS rowformatv2;'

Expand All @@ -18,4 +23,6 @@ run_sql 'SELECT DISTINCT col14 FROM rowformatv2.t1;'
check_contains 'col14: NULL'
check_contains 'col14: 39'

run_sql 'SET @@global.tidb_row_format_version = 1;'
if [ "$row_format" -ne "2" ]; then
run_sql "SET @@global.tidb_row_format_version = $row_format;"
fi