mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-07 13:22:15 +02:00
test: add skip_if_running_under_valgrind()
Enable it in the USDT tests. The context (from 0xB10C): > every time the tracepoint is reached a SIGTRAP is fired. > No matter the tracepoint contents, even with an empty one. > Valgrind intercepts SIGTRAP and aborts. See discussion in #32374.
This commit is contained in:
@@ -117,6 +117,7 @@ class CoinSelectionTracepointTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_python_bcc()
|
self.skip_if_no_python_bcc()
|
||||||
self.skip_if_no_bpf_permissions()
|
self.skip_if_no_bpf_permissions()
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
self.skip_if_running_under_valgrind()
|
||||||
|
|
||||||
def get_tracepoints(self, expected_types):
|
def get_tracepoints(self, expected_types):
|
||||||
events = []
|
events = []
|
||||||
|
@@ -158,6 +158,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_bitcoind_tracepoints()
|
self.skip_if_no_bitcoind_tracepoints()
|
||||||
self.skip_if_no_python_bcc()
|
self.skip_if_no_python_bcc()
|
||||||
self.skip_if_no_bpf_permissions()
|
self.skip_if_no_bpf_permissions()
|
||||||
|
self.skip_if_running_under_valgrind()
|
||||||
|
|
||||||
def added_test(self):
|
def added_test(self):
|
||||||
"""Add a transaction to the mempool and make sure the tracepoint returns
|
"""Add a transaction to the mempool and make sure the tracepoint returns
|
||||||
|
@@ -254,6 +254,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_bitcoind_tracepoints()
|
self.skip_if_no_bitcoind_tracepoints()
|
||||||
self.skip_if_no_python_bcc()
|
self.skip_if_no_python_bcc()
|
||||||
self.skip_if_no_bpf_permissions()
|
self.skip_if_no_bpf_permissions()
|
||||||
|
self.skip_if_running_under_valgrind()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.p2p_message_tracepoint_test()
|
self.p2p_message_tracepoint_test()
|
||||||
|
@@ -150,6 +150,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_bitcoind_tracepoints()
|
self.skip_if_no_bitcoind_tracepoints()
|
||||||
self.skip_if_no_python_bcc()
|
self.skip_if_no_python_bcc()
|
||||||
self.skip_if_no_bpf_permissions()
|
self.skip_if_no_bpf_permissions()
|
||||||
|
self.skip_if_running_under_valgrind()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.wallet = MiniWallet(self.nodes[0])
|
self.wallet = MiniWallet(self.nodes[0])
|
||||||
|
@@ -64,6 +64,7 @@ class ValidationTracepointTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_bitcoind_tracepoints()
|
self.skip_if_no_bitcoind_tracepoints()
|
||||||
self.skip_if_no_python_bcc()
|
self.skip_if_no_python_bcc()
|
||||||
self.skip_if_no_bpf_permissions()
|
self.skip_if_no_bpf_permissions()
|
||||||
|
self.skip_if_running_under_valgrind()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
# Tests the validation:block_connected tracepoint by generating blocks
|
# Tests the validation:block_connected tracepoint by generating blocks
|
||||||
|
@@ -1016,6 +1016,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
if not self.is_external_signer_compiled():
|
if not self.is_external_signer_compiled():
|
||||||
raise SkipTest("external signer support has not been compiled.")
|
raise SkipTest("external signer support has not been compiled.")
|
||||||
|
|
||||||
|
def skip_if_running_under_valgrind(self):
|
||||||
|
"""Skip the running test if Valgrind is being used."""
|
||||||
|
if self.options.valgrind:
|
||||||
|
raise SkipTest("This test is not compatible with Valgrind.")
|
||||||
|
|
||||||
def is_cli_compiled(self):
|
def is_cli_compiled(self):
|
||||||
"""Checks whether bitcoin-cli was compiled."""
|
"""Checks whether bitcoin-cli was compiled."""
|
||||||
return self.config["components"].getboolean("ENABLE_CLI")
|
return self.config["components"].getboolean("ENABLE_CLI")
|
||||||
|
Reference in New Issue
Block a user