Commit a5c807a
committed
test/infamy: make until() exception-safe
Any exception raised by fn() propagated immediately out of the retry
loop, effectively making until() a single-shot call the moment any
transient error occurred.
Fix by wrapping fn() in a try/except inside the loop and treating any
exception as a "not yet" result. The last exception is preserved and
re-raised if all attempts are exhausted, so failure output is still
meaningful. Also fix a missing newline at end of file.
Fixes #1403
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>1 parent b5a292d commit a5c807a
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
122 | | - | |
| 129 | + | |
0 commit comments