Skip to content

Commit

Permalink
Merge branch 'master' into refine-Sink-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sdojjy authored Nov 25, 2021
2 parents 51b754a + b2baebd commit 03a56ff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
10 changes: 6 additions & 4 deletions tests/_utils/start_tidb_cluster_impl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ random_file_name=
# Random generate the sockets config.
# Make sure we dont use the same sock.
randomGenSocketsConf() {
date=$(date '+%s%N')

random_file_name="$OUT_DIR/tidb-config-$date.toml"
random_str=$(date '+%s%N')
if [ "$(uname)" == "Darwin" ]; then
random_str=$(cat /dev/random | LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 10)
fi
random_file_name="$OUT_DIR/tidb-config-$random_str.toml"

cat "$OUT_DIR/tidb-config.toml" >"$random_file_name"
echo "socket = \"/tmp/tidb-$date.sock\"" >>"$random_file_name"
echo "socket = \"/tmp/tidb-$random_str.sock\"" >>"$random_file_name"
}

while [[ ${1} ]]; do
Expand Down
22 changes: 14 additions & 8 deletions tests/_utils/stop_tidb_cluster
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

# cdc server is ran by binary cdc.test, kill cdc server first to avoid too much
# noise in cdc logs.
killall -q -w -s 9 cdc.test || true
killall -q -w -s 9 cdc || true
killall -q -w -s 9 cdc_state_checker || true
killall -q -w -s 9 tidb-server || true
killall -q -w -s 9 tikv-server || true
killall -q -w -s 9 tiflash || true
killall -q -w -s 9 flash_cluster_manager || true
killall -q -w -s 9 pd-server || true

PKILL="killall -q -w -s 9 "
if [ "$(uname)" == "Darwin" ]; then
PKILL="pkill -9 "
fi

${PKILL} cdc.test || true
${PKILL} cdc || true
${PKILL} cdc_state_checker || true
${PKILL} tidb-server || true
${PKILL} tikv-server || true
${PKILL} tiflash || true
${PKILL} flash_cluster_manager || true
${PKILL} pd-server || true

CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
source $CUR/../_utils/test_prepare
Expand Down

0 comments on commit 03a56ff

Please sign in to comment.