diff --git a/contrib/seeds/test-seeds.sh b/contrib/seeds/test-seeds.sh --- a/contrib/seeds/test-seeds.sh +++ b/contrib/seeds/test-seeds.sh @@ -9,6 +9,7 @@ TOPLEVEL=$(git rev-parse --show-toplevel) DEFAULT_BUILD_DIR="${TOPLEVEL}/build" +DEFAULT_RPC_PORT=18832 help_message() { echo "Test connecting to seed nodes. Outputs the seeds that were successfully connected to." @@ -23,6 +24,7 @@ echo "" echo "Environment Variables:" echo "BUILD_DIR Default: ${DEFAULT_BUILD_DIR}" + echo "RPC_PORT Default: ${DEFAULT_RPC_PORT}" exit 0 } @@ -60,8 +62,9 @@ fi TEMP_DATADIR=$(mktemp -d) -BITCOIND="${BITCOIND} -datadir=${TEMP_DATADIR} ${OPTION_TESTNET} -rpcport=18832 -connect=0 -daemon" -BITCOIN_CLI="${BITCOIN_CLI} -datadir=${TEMP_DATADIR} ${OPTION_TESTNET} -rpcport=18832" +: "${RPC_PORT:=${DEFAULT_RPC_PORT}}" +BITCOIND="${BITCOIND} -datadir=${TEMP_DATADIR} ${OPTION_TESTNET} -rpcport=${RPC_PORT} -connect=0 -daemon" +BITCOIN_CLI="${BITCOIN_CLI} -datadir=${TEMP_DATADIR} ${OPTION_TESTNET} -rpcport=${RPC_PORT}" >&2 echo "Spinning up bitcoind..." ${BITCOIND} || { diff --git a/contrib/teamcity/build-configurations.sh b/contrib/teamcity/build-configurations.sh --- a/contrib/teamcity/build-configurations.sh +++ b/contrib/teamcity/build-configurations.sh @@ -254,8 +254,10 @@ check-seeds) "${CI_SCRIPTS_DIR}"/build_cmake.sh - "${CI_SCRIPTS_DIR}"/check-seeds.sh main 80 - "${CI_SCRIPTS_DIR}"/check-seeds.sh test 70 + # Run on different ports to avoid a race where the rpc port used in the + # first run may not be closed in time for the second to start. + RPC_PORT=18832 "${CI_SCRIPTS_DIR}"/check-seeds.sh main 80 + RPC_PORT=18833 "${CI_SCRIPTS_DIR}"/check-seeds.sh test 70 ;; *)