Logs with special case handling:
2025-07-17T15:07:39.774663Z TestFramework (ERROR): Called Process failed with 'None'
2025-07-17T15:18:22.039274Z TestFramework (WARNING): Exiting after keyboard interrupt
Logs without special case handling:
2025-07-17T15:19:09.169925Z TestFramework (ERROR): CalledProcessError(1, ['ls', '--invalid-flag'])
2025-07-17T15:19:26.639162Z TestFramework (ERROR): KeyboardInterrupt()
Imo, they're equally informative for KeyboardInterrupt, and more informative without special case handling for CalledProcessError, with less code.
<details>
<summary>git diff on fa86ba62de</summary>
diff --git a/test/functional/feature_abortnode.py b/test/functional/feature_abortnode.py
index a5c8aa163a..748875b25d 100755
--- a/test/functional/feature_abortnode.py
+++ b/test/functional/feature_abortnode.py
@@ -22,6 +22,8 @@ class AbortNodeTest(BitcoinTestFramework):
# We'll connect the nodes later
def run_test(self):
+ import subprocess
+ subprocess.run(["ls", "--invalid-flag"], check=True)
self.generate(self.nodes[0], 3, sync_fun=self.no_op)
# Deleting the undo file will result in reorg failure
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 823d946cfe..17e5a6b397 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -197,14 +197,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
except SkipTest as e:
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.success = TestStatus.FAILED
except BaseException as e:
- self.log.exception(f"Unexpected exception")
+ self.log.exception(repr(e))
self.success = TestStatus.FAILED
finally:
exit_code = self.shutdown()
</details>