Commit b7ee5fb
Merge bitcoin/bitcoin#33001: test: Do not pass tests on unhandled exceptions
faa3e684118bffa7a98cf76eeeb59243219df900 test: Log KeyboardInterrupt as exception (MarcoFalke)
fa30b34026f76a5b8af997152fced2d281782e0d test: Do not pass tests on unhandled exceptions (MarcoFalke)
Pull request description:
Currently the functional tests are problematic, because they pass, even if they encounter an unhanded exception.
Fix this by handling all exceptions: Catch `BaseException` as fallback and mark it as failure.
Can be tested via:
```diff
diff --git a/test/functional/wallet_disable.py b/test/functional/wallet_disable.py
index da6e5d4..ecc41fb041 100755
--- a/test/functional/wallet_disable.py
+++ b/test/functional/wallet_disable.py
@@ -19,6 +19,7 @@ class DisableWalletTest (BitcoinTestFramework):
self.wallet_names = []
def run_test (self):
+ import sys;sys.exit("fatal error")
# Make sure wallet is really disabled
assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo)
x = self.nodes[0].validateaddress('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')
```
Previously, the test would pass. With this patch, it would fail.
ACKs for top commit:
enirox001:
Looks good to me—ACK faa3e68
stickies-v:
re-ACK faa3e684118bffa7a98cf76eeeb59243219df900
pablomartin4btc:
tACK faa3e684118bffa7a98cf76eeeb59243219df900
Tree-SHA512: 11ecd5201982e2c776e48d98834b17c15a415306a95524bc702daeba20a316aac797748e9592be8db575597804f149ee7ef104416037cc9e5891758625810e2d1 parent 1ac1f75 commit b7ee5fb
File tree
2 files changed
+4
-16
lines changed- src
- test/functional/test_framework
2 files changed
+4
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3817 | 3817 | | |
3818 | 3818 | | |
3819 | 3819 | | |
3820 | | - | |
| 3820 | + | |
3821 | 3821 | | |
3822 | 3822 | | |
3823 | 3823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | 136 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 137 | + | |
150 | 138 | | |
151 | | - | |
152 | | - | |
| 139 | + | |
| 140 | + | |
153 | 141 | | |
154 | 142 | | |
155 | 143 | | |
| |||
0 commit comments