Skip to content

Commit

Permalink
tests: Fix unstable integration tests (#8205)
Browse files Browse the repository at this point in the history
close #8206
  • Loading branch information
JaySon-Huang authored Oct 18, 2023
1 parent dcb0173 commit 42b072f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function wait_env() {

for (( i = 0; i < "${timeout}"; i++ )); do
if [[ -n $(cat ./log/tidb0/tidb.log | grep "server is running MySQL protocol") && \
-n $(cat ./log/tiflash/server.log | grep "Ready for connections") ]]; then
-n $(cat ./log/tiflash/server.log | grep "Start to wait for terminal signal") ]]; then
local failed='false'
break
fi
Expand Down Expand Up @@ -88,4 +88,4 @@ docker-compose -f cluster.yaml -f tiflash-tagged-image.yaml down
rm -rf ./data ./log

[[ "$TIDB_CI_ONLY" -eq 1 ]] && exit
#################################### TIDB-CI ONLY ####################################
#################################### TIDB-CI ONLY ####################################
4 changes: 2 additions & 2 deletions tests/docker/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function wait_env() {

for (( i = 0; i < "${timeout}"; i++ )); do
if [[ -n $(cat ./log/tidb0/tidb.log | grep "server is running MySQL protocol") && \
-n $(cat ./log/tiflash/server.log | grep "Ready for connections") ]]; then
-n $(cat ./log/tiflash/server.log | grep "Start to wait for terminal signal") ]]; then
local failed='false'
break
fi
Expand All @@ -67,7 +67,7 @@ function wait_tiflash_env() {
echo "=> wait for env available"

for (( i = 0; i < "${timeout}"; i++ )); do
if [[ -n $(cat ./log/tiflash/server.log | grep "Ready for connections") ]]; then
if [[ -n $(cat ./log/tiflash/server.log | grep "Start to wait for terminal signal") ]]; then
local failed='false'
break
fi
Expand Down
44 changes: 44 additions & 0 deletions tests/fullstack-test2/ddl/alter_partition_by.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,28 @@ mysql> insert into test.t select a+1000000,a+1000000,-(a+1000000) from test.t;

func> wait_table test t

mysql> select /*+ READ_FROM_STORAGE(TIFLASH[t]) */ * from test.t order by a;
+---------+---------+----------+
| a | b | c |
+---------+---------+----------+
| 1 | 1 | -1 |
| 2 | 2 | -2 |
| 3 | 3 | -3 |
| 4 | 4 | -4 |
| 500001 | 500001 | -500001 |
| 500002 | 500002 | -500002 |
| 500003 | 500003 | -500003 |
| 500004 | 500004 | -500004 |
| 1000001 | 1000001 | -1000001 |
| 1000002 | 1000002 | -1000002 |
| 1000003 | 1000003 | -1000003 |
| 1000004 | 1000004 | -1000004 |
| 1500001 | 1500001 | -1500001 |
| 1500002 | 1500002 | -1500002 |
| 1500003 | 1500003 | -1500003 |
| 1500004 | 1500004 | -1500004 |
+---------+---------+----------+

# check table info in tiflash
>> select tidb_database,tidb_name from system.tables where tidb_database = 'test' and tidb_name = 't' and is_tombstone = 0
┌─tidb_database─┬─tidb_name─┐
Expand Down Expand Up @@ -122,6 +144,28 @@ mysql> alter table test.t2 set tiflash replica 1;
mysql> insert into test.t2 select * from test.t;
func> wait_table test t2

mysql> select /*+ READ_FROM_STORAGE(TIFLASH[t2]) */ * from test.t2 order by a;
+---------+---------+----------+
| a | b | c |
+---------+---------+----------+
| 1 | 1 | -1 |
| 2 | 2 | -2 |
| 3 | 3 | -3 |
| 4 | 4 | -4 |
| 500001 | 500001 | -500001 |
| 500002 | 500002 | -500002 |
| 500003 | 500003 | -500003 |
| 500004 | 500004 | -500004 |
| 1000001 | 1000001 | -1000001 |
| 1000002 | 1000002 | -1000002 |
| 1000003 | 1000003 | -1000003 |
| 1000004 | 1000004 | -1000004 |
| 1500001 | 1500001 | -1500001 |
| 1500002 | 1500002 | -1500002 |
| 1500003 | 1500003 | -1500003 |
| 1500004 | 1500004 | -1500004 |
+---------+---------+----------+

mysql> drop table test.t;

>> select tidb_database,tidb_name from system.tables where tidb_database = 'test' and tidb_name = 't2' and is_tombstone = 0
Expand Down

0 comments on commit 42b072f

Please sign in to comment.