Skip to content

Commit 4e35595

Browse files
committed
Merge rust-bitcoin#213: Fix integration test failures by making Node::with_conf more robust
8c9a4a4 Revert "integration_test: Pause after node comes up" (Jamil Lambert, PhD) 66e7e7c Refactor Node::with_conf (Jamil Lambert, PhD) 2b8fad9 Split out sections into helper functions (Jamil Lambert, PhD) Pull request description: The intermittent integration test failures are caused by race conditions in the creation of the node, wallet or the cookie file. Change `Node::with_conf` to check if there is a problem and retry the section where it occurred, or if that still fails retry the whole process of starting the node. First patch: - Split out some sections into helper functions. Second patch: - Remove the loop in `with_conf()` that creates `client`, instead loop over the individual parts. - Create helper functions for creating the `client`, and creating or loading the client `wallet`, both with their own retry logic. - Reduce the sleep time between retries to reduce the delay, since it looks like the errors happen over shorter time periods than the existing 1 second wait. - Add functions to wait until the client and the cookie file are available. - Add a loop to retry the whole process if it fails, since the integration tests pass when repeated, just repeat this section where the failures occur instead. - Remove all the debugging outputs since it all works now they are not needed. - Update the rustdocs for the function. Third patch: - Revert rust-bitcoin#206, since the issue is now solved at it’s source the pause is no longer needed. Closes rust-bitcoin#205 ACKs for top commit: tcharding: ACK 8c9a4a4 Tree-SHA512: d80ef5e4def47025e830dd84aaa99e8ed0b71302f95bfc3d0ec210226444ce45a0679c569c5cbcf152cccc3222f812e4a8e5ab4ed5383a89ae2539f1f49baed4
2 parents a06bfa4 + 8c9a4a4 commit 4e35595

File tree

2 files changed

+212
-154
lines changed

2 files changed

+212
-154
lines changed

integration_test/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ impl NodeExt for Node {
6969
conf.args.push(arg);
7070
}
7171

72-
let node = Node::with_conf(exe, &conf).expect("failed to create node");
73-
// We are getting intermittent test fails.
74-
// Just pause here to give the node time to sort itself out.
75-
std::thread::sleep(std::time::Duration::from_millis(500));
76-
node
72+
Node::with_conf(exe, &conf).expect("failed to create node")
7773
}
7874

7975
fn fund_wallet(&self) {

0 commit comments

Comments
 (0)