We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29bdc35 commit 25f4106Copy full SHA for 25f4106
src/tests/functional_tests.rs
@@ -91,6 +91,7 @@ fn wait_for_outpoint_spend(outpoint: OutPoint) {
91
if is_spent {
92
break;
93
}
94
+
95
is_spent = exponential_backoff_poll(|| {
96
get_electrsd().trigger().unwrap();
97
get_electrsd().client.ping().unwrap();
@@ -104,13 +105,18 @@ where
104
105
F: FnMut() -> Option<T>,
106
{
107
let mut delay = Duration::from_millis(64);
108
+ let mut tries = 0;
109
loop {
110
match poll() {
111
Some(data) => break data,
- None if delay.as_millis() < 512 => delay = delay.mul_f32(2.0),
112
+ None if delay.as_millis() < 512 => {
113
+ delay = delay.mul_f32(2.0);
114
+ }
115
116
None => {}
117
-
118
+ assert!(tries < 10, "Reached max tries.");
119
+ tries += 1;
120
std::thread::sleep(delay);
121
122
0 commit comments