Skip to content

Commit 3ab2582

Browse files
author
MarcoFalke
committed
Merge #19730: ci: Set increased --timeout-factor by default
fa330ec test: Remove confusing and broken use of wait_until global (MarcoFalke) fa6583c ci: Set increased --timeout-factor by default (MarcoFalke) Pull request description: Assuming that tests don't have a logic error or race, setting a high timeout should not cause any issues. The tests will still pass just as fast in the fastest case, but it allows for some buffer in case of slow disks or otherwise starved ci machines. Fixes #19729 ACKs for top commit: hebasto: ACK fa330ec, I have reviewed the code, and it looks OK, I agree it can be merged. Tree-SHA512: 3da80ee008c7b08bab5fdaf7804d57c79d6fed49a7d37b9c54fc89756659fcb9981fd10afc4d07bd90d93c1699fd410a0110a3cd34d016873759d114ce3cd82d
2 parents 4cde973 + fa330ec commit 3ab2582

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

ci/test/00_setup_env.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
3535
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
3636
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
3737
export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
38+
# By how much to scale the test_runner timeouts (option --timeout-factor).
39+
# This is needed because some ci machines have slow CPU or disk, so sanitizers
40+
# might be slow or a reindex might be waiting on disk IO.
41+
export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-4}
3842
export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-}
3943
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
4044
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}

ci/test/00_setup_env_native_asan.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ export CONTAINER_NAME=ci_native_asan
1010
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
1111
export DOCKER_NAME_TAG=ubuntu:20.04
1212
export NO_DEPENDS=1
13-
export TEST_RUNNER_EXTRA="--timeout-factor=4" # Increase timeout because sanitizers slow down
1413
export GOAL="install"
1514
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++ --with-boost-process"

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export CONTAINER_NAME=ci_native_tsan
1010
export DOCKER_NAME_TAG=ubuntu:20.04
1111
export PACKAGES="clang llvm libc++abi-dev libc++-dev python3-zmq"
1212
export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'"
13-
export TEST_RUNNER_EXTRA="--exclude feature_block --timeout-factor=4" # Increase timeout because sanitizers slow down. Low memory on Travis machines, exclude feature_block.
13+
export TEST_RUNNER_EXTRA="--exclude feature_block" # Low memory on Travis machines, exclude feature_block.
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-zmq --with-gui=no CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' CXXFLAGS='-g' --with-sanitizers=thread CC=clang CXX='clang++ -stdlib=libc++' --with-boost-process"

ci/test/00_setup_env_native_valgrind.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export CONTAINER_NAME=ci_native_valgrind
1010
export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev"
1111
export USE_VALGRIND=1
1212
export NO_DEPENDS=1
13-
export TEST_RUNNER_EXTRA="--exclude rpc_bind --timeout-factor=4" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
13+
export TEST_RUNNER_EXTRA="--exclude rpc_bind" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI

ci/test/06_script_b.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535

3636
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
3737
BEGIN_FOLD functional-tests
38-
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} test/functional/test_runner.py --ci $MAKEJOBS --tmpdirprefix "${BASE_SCRATCH_DIR}/test_runner/" --ansi --combinedlogslen=4000 ${TEST_RUNNER_EXTRA} --quiet --failfast
38+
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} test/functional/test_runner.py --ci $MAKEJOBS --tmpdirprefix "${BASE_SCRATCH_DIR}/test_runner/" --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --quiet --failfast
3939
END_FOLD
4040
fi
4141

test/functional/wallet_basic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
assert_fee_amount,
1313
assert_raises_rpc_error,
1414
connect_nodes,
15-
wait_until,
1615
)
1716
from test_framework.wallet_util import test_address
1817

@@ -540,7 +539,7 @@ def run_test(self):
540539
self.start_node(2, [m, "-limitancestorcount=" + str(chainlimit)])
541540
if m == '-reindex':
542541
# reindex will leave rpc warm up "early"; Wait for it to finish
543-
wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)])
542+
self.wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)])
544543
assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)])
545544

546545
# Exercise listsinceblock with the last two blocks
@@ -589,7 +588,7 @@ def run_test(self):
589588
self.start_node(0, extra_args=extra_args)
590589

591590
# wait until the wallet has submitted all transactions to the mempool
592-
wait_until(lambda: len(self.nodes[0].getrawmempool()) == chainlimit * 2)
591+
self.wait_until(lambda: len(self.nodes[0].getrawmempool()) == chainlimit * 2)
593592

594593
node0_balance = self.nodes[0].getbalance()
595594
# With walletrejectlongchains we will not create the tx and store it in our wallet.

0 commit comments

Comments
 (0)