From 95dc4430a344d2f22fd6b6966fd530f1364872ad Mon Sep 17 00:00:00 2001 From: Ping Yu Date: Fri, 25 Aug 2023 16:08:56 +0800 Subject: [PATCH] fix flaky it http_api (#351) Signed-off-by: Ping Yu --- cdc/tests/integration_tests/_utils/start_tidb_cluster | 11 ++++++++--- .../integration_tests/_utils/start_tidb_cluster_impl | 8 +++++++- .../_utils/start_tls_tidb_cluster_impl | 1 + cdc/tests/integration_tests/http_api/run.sh | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cdc/tests/integration_tests/_utils/start_tidb_cluster b/cdc/tests/integration_tests/_utils/start_tidb_cluster index 2b44005c..69f95218 100755 --- a/cdc/tests/integration_tests/_utils/start_tidb_cluster +++ b/cdc/tests/integration_tests/_utils/start_tidb_cluster @@ -11,6 +11,7 @@ tidb_config= pd_config= retry_times=10 multiple_upstream_pd="false" +tikv_count=3 while [[ ${1-} ]]; do case "${1}" in @@ -34,6 +35,10 @@ while [[ ${1-} ]]; do multiple_upstream_pd=${2} shift ;; + --tikv-count) + tikv_count=${2} + shift + ;; *) echo "Unknown parameter: ${1}" >&2 exit 1 @@ -55,11 +60,11 @@ while [ $i -le "$retry_times" ]; do echo "The ${i} times to try to start tidb cluster..." if [[ "$tidb_config" != "" ]]; then - start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" --tidb-config "${tidb_config}" + start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" --tidb-config "${tidb_config}" --tikv-count "${tikv_count}" elif [[ "$pd_config" != "" ]]; then - start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" --pd-config "${pd_config}" + start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" --pd-config "${pd_config}" --tikv-count "${tikv_count}" else - start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" + start_tidb_cluster_impl --workdir "${OUT_DIR}" --multiple-upstream-pd "${multiple_upstream_pd}" --tikv-count "${tikv_count}" fi if [ $? -eq 0 ]; then diff --git a/cdc/tests/integration_tests/_utils/start_tidb_cluster_impl b/cdc/tests/integration_tests/_utils/start_tidb_cluster_impl index b793fb24..70e5c26b 100755 --- a/cdc/tests/integration_tests/_utils/start_tidb_cluster_impl +++ b/cdc/tests/integration_tests/_utils/start_tidb_cluster_impl @@ -12,6 +12,7 @@ pd_config= multiple_upstream_pd= random_file_name= verify_tidb=false +tikv_count=3 # Random generate the sockets config. # Make sure we dont use the same sock. @@ -47,6 +48,10 @@ while [[ ${1-} ]]; do --verify-tidb) vierfy_tidb=true ;; + --tikv-count) + tikv_count=${2} + shift + ;; *) echo "Unknown parameter: ${1}" >&2 exit 1 @@ -168,6 +173,7 @@ cat - >"$OUT_DIR/tikv-config.toml" <