From 79e1a3c9c6a4661562d419dc3427b35060ed0451 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 17 Jul 2025 13:00:05 +0200 Subject: [PATCH 1/3] test: Do not pass tests on unhandled exceptions This adds a missing catch for BaseException (e.g. SystemExit), which would otherwise be silently ignored. Also, remove the redundant other catches, which are just calling log.exception with a redundant log message. Github-Pull: #33001 Rebased-From: fa30b34026f76a5b8af997152fced2d281782e0d --- test/functional/test_framework/test_framework.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index d5b338f2ba2..1de527f7ba6 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -134,27 +134,18 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): else: self.run_test() - except JSONRPCException: - self.log.exception("JSONRPC error") - self.success = TestStatus.FAILED except SkipTest as e: self.log.warning("Test Skipped: %s" % e.message) self.success = TestStatus.SKIPPED - except AssertionError: - self.log.exception("Assertion failed") - self.success = TestStatus.FAILED - except KeyError: - self.log.exception("Key error") - self.success = TestStatus.FAILED except subprocess.CalledProcessError as e: self.log.exception("Called Process failed with '{}'".format(e.output)) self.success = TestStatus.FAILED - except Exception: - self.log.exception("Unexpected exception caught during testing") - self.success = TestStatus.FAILED except KeyboardInterrupt: self.log.warning("Exiting after keyboard interrupt") self.success = TestStatus.FAILED + except BaseException: + self.log.exception("Unexpected exception") + self.success = TestStatus.FAILED finally: exit_code = self.shutdown() sys.exit(exit_code) From 5e327e6703f10d3de12c56bb9701b07521a9f703 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 18 Jul 2025 07:36:32 +0200 Subject: [PATCH 2/3] test: Log KeyboardInterrupt as exception log.exception is more verbose and useful to debug timeouts. Also, log stderr for CalledProcessError to make debugging easier. Github-Pull: #33001 Rebased-From: faa3e684118bffa7a98cf76eeeb59243219df900 --- test/functional/test_framework/test_framework.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 1de527f7ba6..ab87cfa5ea6 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -138,10 +138,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.log.warning("Test Skipped: %s" % e.message) self.success = TestStatus.SKIPPED except subprocess.CalledProcessError as e: - self.log.exception("Called Process failed with '{}'".format(e.output)) - self.success = TestStatus.FAILED - except KeyboardInterrupt: - self.log.warning("Exiting after keyboard interrupt") + self.log.exception(f"Called Process failed with stdout='{e.stdout}'; stderr='{e.stderr}';") self.success = TestStatus.FAILED except BaseException: self.log.exception("Unexpected exception") From 411e15194b3a770ff455d413a0fe2495f0362297 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 23 Jul 2025 16:47:49 +0100 Subject: [PATCH 3/3] doc: update release notes for 29.x --- doc/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index 3a39efadbce..d09772ff330 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -68,6 +68,7 @@ Notable changes - #32841 feature_taproot: sample tx version border values more - #32850 test: check P2SH sigop count for coinbase tx - #32859 test: correctly detect nonstd TRUC tx vsize in feature_taproot +- #33001 test: Do not pass tests on unhandled exceptions ### Util