Skip to content

Commit 0824b3f

Browse files
authored
Merge pull request #1257 from Jolah1/fix-lsps2-prune-test-close-race
Fix `ChannelClosingFailed` flake in `lsps2_service_prunes_closed_channel_state`
2 parents fb63dfe + ad5a05c commit 0824b3f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎tests/integration_tests_rust.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8790,7 +8790,15 @@ async fn lsps2_service_prunes_closed_channel_state() {
87908790

87918791
assert_eq!(list_lsps2_peer_states().await, vec![client_node.node_id().to_string()]);
87928792

8793-
client_node.close_channel(&client_user_channel_id, service_node.node_id()).unwrap();
8793+
// The client may still be persisting the monitor updates for the claim it just made, and LDK
8794+
// won't begin a cooperative shutdown while one is in flight.
8795+
tokio::time::timeout(Duration::from_secs(common::INTEROP_TIMEOUT_SECS), async {
8796+
while client_node.close_channel(&client_user_channel_id, service_node.node_id()).is_err() {
8797+
tokio::time::sleep(Duration::from_millis(100)).await;
8798+
}
8799+
})
8800+
.await
8801+
.expect("the client should be able to close the channel");
87948802
expect_event!(client_node, ChannelClosed);
87958803
expect_event!(service_node, ChannelClosed);
87968804

0 commit comments

Comments
 (0)