Merge bitcoin/bitcoin#33046: [29.x] test: Do not pass tests on unhandled exceptions

411e15194b doc: update release notes for 29.x (fanquake)
5e327e6703 test: Log KeyboardInterrupt as exception (MarcoFalke)
79e1a3c9c6 test: Do not pass tests on unhandled exceptions (MarcoFalke)

Pull request description:

  Backports #33001 to `29.x`.

ACKs for top commit:
  pablomartin4btc:
    ACK 411e15194b
  marcofleon:
    lgtm ACK 411e15194b

Tree-SHA512: ea930f8c24a0a5e18f2107e96540db5c39941442059190d6104dfcf88b4a33d06ecaa7dbdf8baa91e564ee7ca3d12df5118c7fa404a38108de4ad0e5f122f72d
This commit is contained in:
merge-script
2025-07-24 12:15:56 +01:00
2 changed files with 4 additions and 15 deletions

View File

@@ -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

View File

@@ -134,26 +134,14 @@ 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.log.exception(f"Called Process failed with stdout='{e.stdout}'; stderr='{e.stderr}';")
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")
except BaseException:
self.log.exception("Unexpected exception")
self.success = TestStatus.FAILED
finally:
exit_code = self.shutdown()