0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00

Merge #18392: ci: Run feature_block in valgrind

fa92af5af3 ci: Run feature_block and feature_abortnode in valgrind (MarcoFalke)
fa01febeaf test: Remove ci timeout restriction in test_runner (MarcoFalke)

Pull request description:

  Also revert commit 0a4912e46a, because some tests take too long for this to be useful anymore.

Top commit has no ACKs.

Tree-SHA512: 363f14766e1f4a5860ab668a516b41acebc6fbdf11d8defb3a95a772dbf82304ca1f5f14b1dbad97f2029503e03d92e8c69df0466a8872409c20665838f617ed
This commit is contained in:
MarcoFalke 2020-03-23 07:37:38 -04:00
commit d478a737db
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
4 changed files with 10 additions and 17 deletions

View file

@ -10,7 +10,6 @@ export CONTAINER_NAME=ci_native_valgrind
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" 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"
export USE_VALGRIND=1 export USE_VALGRIND=1
export NO_DEPENDS=1 export NO_DEPENDS=1
export TEST_RUNNER_EXTRA="--exclude feature_abortnode,feature_block,rpc_bind" # Excluded for now export TEST_RUNNER_EXTRA="--exclude rpc_bind" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
export RUN_FUNCTIONAL_TESTS=true
export GOAL="install" export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI

View file

@ -14,11 +14,12 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import wait_until, get_datadir_path, connect_nodes from test_framework.util import wait_until, get_datadir_path, connect_nodes
import os import os
class AbortNodeTest(BitcoinTestFramework):
class AbortNodeTest(BitcoinTestFramework):
def set_test_params(self): def set_test_params(self):
self.setup_clean_chain = True self.setup_clean_chain = True
self.num_nodes = 2 self.num_nodes = 2
self.rpc_timeout = 240
def setup_network(self): def setup_network(self):
self.setup_nodes() self.setup_nodes()
@ -44,5 +45,6 @@ class AbortNodeTest(BitcoinTestFramework):
self.log.info("Node crashed - now verifying restart fails") self.log.info("Node crashed - now verifying restart fails")
self.nodes[0].assert_start_raises_init_error() self.nodes[0].assert_start_raises_init_error()
if __name__ == '__main__': if __name__ == '__main__':
AbortNodeTest().main() AbortNodeTest().main()

View file

@ -1263,7 +1263,7 @@ class FullBlockTest(BitcoinTestFramework):
self.save_spendable_output() self.save_spendable_output()
spend = self.get_spendable_output() spend = self.get_spendable_output()
self.send_blocks(blocks, True, timeout=1920) self.send_blocks(blocks, True, timeout=2440)
chain1_tip = i chain1_tip = i
# now create alt chain of same length # now create alt chain of same length
@ -1275,14 +1275,14 @@ class FullBlockTest(BitcoinTestFramework):
# extend alt chain to trigger re-org # extend alt chain to trigger re-org
block = self.next_block("alt" + str(chain1_tip + 1), version=4) block = self.next_block("alt" + str(chain1_tip + 1), version=4)
self.send_blocks([block], True, timeout=1920) self.send_blocks([block], True, timeout=2440)
# ... and re-org back to the first chain # ... and re-org back to the first chain
self.move_tip(chain1_tip) self.move_tip(chain1_tip)
block = self.next_block(chain1_tip + 1, version=4) block = self.next_block(chain1_tip + 1, version=4)
self.send_blocks([block], False, force_send=True) self.send_blocks([block], False, force_send=True)
block = self.next_block(chain1_tip + 2, version=4) block = self.next_block(chain1_tip + 2, version=4)
self.send_blocks([block], True, timeout=1920) self.send_blocks([block], True, timeout=2440)
self.log.info("Reject a block with an invalid block header version") self.log.info("Reject a block with an invalid block header version")
b_v1 = self.next_block('b_v1', version=1) b_v1 = self.next_block('b_v1', version=1)

View file

@ -19,9 +19,8 @@ import datetime
import os import os
import time import time
import shutil import shutil
import signal
import sys
import subprocess import subprocess
import sys
import tempfile import tempfile
import re import re
import logging import logging
@ -366,11 +365,10 @@ def main():
args=passon_args, args=passon_args,
combined_logs_len=args.combinedlogslen, combined_logs_len=args.combinedlogslen,
failfast=args.failfast, failfast=args.failfast,
runs_ci=args.ci,
use_term_control=args.ansi, use_term_control=args.ansi,
) )
def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, runs_ci, use_term_control): def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, use_term_control):
args = args or [] args = args or []
# Warn if bitcoind is already running # Warn if bitcoind is already running
@ -412,7 +410,6 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
tmpdir=tmpdir, tmpdir=tmpdir,
test_list=test_list, test_list=test_list,
flags=flags, flags=flags,
timeout_duration=40 * 60 if runs_ci else float('inf'), # in seconds
use_term_control=use_term_control, use_term_control=use_term_control,
) )
start_time = time.time() start_time = time.time()
@ -497,12 +494,11 @@ class TestHandler:
Trigger the test scripts passed in via the list. Trigger the test scripts passed in via the list.
""" """
def __init__(self, *, num_tests_parallel, tests_dir, tmpdir, test_list, flags, timeout_duration, use_term_control): def __init__(self, *, num_tests_parallel, tests_dir, tmpdir, test_list, flags, use_term_control):
assert num_tests_parallel >= 1 assert num_tests_parallel >= 1
self.num_jobs = num_tests_parallel self.num_jobs = num_tests_parallel
self.tests_dir = tests_dir self.tests_dir = tests_dir
self.tmpdir = tmpdir self.tmpdir = tmpdir
self.timeout_duration = timeout_duration
self.test_list = test_list self.test_list = test_list
self.flags = flags self.flags = flags
self.num_running = 0 self.num_running = 0
@ -543,10 +539,6 @@ class TestHandler:
time.sleep(.5) time.sleep(.5)
for job in self.jobs: for job in self.jobs:
(name, start_time, proc, testdir, log_out, log_err) = job (name, start_time, proc, testdir, log_out, log_err) = job
if int(time.time() - start_time) > self.timeout_duration:
# Timeout individual tests if timeout is specified (to stop
# tests hanging and not providing useful output).
proc.send_signal(signal.SIGINT)
if proc.poll() is not None: if proc.poll() is not None:
log_out.seek(0), log_err.seek(0) log_out.seek(0), log_err.seek(0)
[stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)] [stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)]