From 8985c4b540e4c2d0b0ea96c2e2a15b4d696f25b5 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Wed, 22 Nov 2023 21:08:29 +0100 Subject: [PATCH] add a delay --- itest/lsps0_protocol_version_test.go | 4 ++++ itest/lsps2_buy_test.go | 3 +++ itest/lsps2_cltv_test.go | 3 +++ itest/lsps2_get_info_test.go | 3 +++ itest/lsps2_get_versions_test.go | 4 ++++ itest/lsps2_happy_flow_test.go | 3 +++ itest/lsps2_no_balance_test.go | 3 +++ itest/lsps2_zero_conf_utxo_test.go | 3 +++ 8 files changed, 26 insertions(+) diff --git a/itest/lsps0_protocol_version_test.go b/itest/lsps0_protocol_version_test.go index d0d332d3..8c356b42 100644 --- a/itest/lsps0_protocol_version_test.go +++ b/itest/lsps0_protocol_version_test.go @@ -3,6 +3,7 @@ package itest import ( "encoding/hex" "encoding/json" + "time" "github.com/breez/lntest" "github.com/breez/lspd/lsps0" @@ -12,6 +13,9 @@ import ( func testLsps0GetProtocolVersions(p *testParams) { p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + rawMsg := `{ "method": "lsps0.list_protocols", "jsonrpc": "2.0", diff --git a/itest/lsps2_buy_test.go b/itest/lsps2_buy_test.go index 10be44f1..e328e41c 100644 --- a/itest/lsps2_buy_test.go +++ b/itest/lsps2_buy_test.go @@ -22,6 +22,9 @@ func testLsps2Buy(p *testParams) { }) p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + p.BreezClient().Node().SendCustomMessage(&lntest.CustomMsgRequest{ PeerId: hex.EncodeToString(p.Lsp().NodeId()), Type: lsps0.Lsps0MessageType, diff --git a/itest/lsps2_cltv_test.go b/itest/lsps2_cltv_test.go index ba46a845..03ab5b85 100644 --- a/itest/lsps2_cltv_test.go +++ b/itest/lsps2_cltv_test.go @@ -24,6 +24,9 @@ func testLsps2Cltv(p *testParams) { log.Print("Connecting bob to lspd") p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + log.Printf("Calling lsps2.get_info") info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{ Token: &WorkingToken, diff --git a/itest/lsps2_get_info_test.go b/itest/lsps2_get_info_test.go index 0ffca855..f0d70b50 100644 --- a/itest/lsps2_get_info_test.go +++ b/itest/lsps2_get_info_test.go @@ -26,6 +26,9 @@ func testLsps2GetInfo(p *testParams) { }) p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + rawMsg := `{ "method": "lsps2.get_info", "jsonrpc": "2.0", diff --git a/itest/lsps2_get_versions_test.go b/itest/lsps2_get_versions_test.go index b817ca6e..17c8262b 100644 --- a/itest/lsps2_get_versions_test.go +++ b/itest/lsps2_get_versions_test.go @@ -4,6 +4,7 @@ import ( "encoding/hex" "encoding/json" "log" + "time" "github.com/breez/lntest" "github.com/breez/lspd/lsps0" @@ -13,6 +14,9 @@ import ( func testLsps2GetVersions(p *testParams) { p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + rawMsg := `{ "method": "lsps2.get_versions", "jsonrpc": "2.0", diff --git a/itest/lsps2_happy_flow_test.go b/itest/lsps2_happy_flow_test.go index 137370a8..446d7d1c 100644 --- a/itest/lsps2_happy_flow_test.go +++ b/itest/lsps2_happy_flow_test.go @@ -24,6 +24,9 @@ func testLsps2HappyFlow(p *testParams) { log.Print("Connecting bob to lspd") p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + log.Printf("Calling lsps2.get_info") info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{ Token: &WorkingToken, diff --git a/itest/lsps2_no_balance_test.go b/itest/lsps2_no_balance_test.go index 06952bcd..6720e02e 100644 --- a/itest/lsps2_no_balance_test.go +++ b/itest/lsps2_no_balance_test.go @@ -23,6 +23,9 @@ func testLsps2NoBalance(p *testParams) { log.Print("Connecting bob to lspd") p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + log.Printf("Calling lsps2.get_info") info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{ Token: &WorkingToken, diff --git a/itest/lsps2_zero_conf_utxo_test.go b/itest/lsps2_zero_conf_utxo_test.go index dba72590..cde406bd 100644 --- a/itest/lsps2_zero_conf_utxo_test.go +++ b/itest/lsps2_zero_conf_utxo_test.go @@ -37,6 +37,9 @@ func testLsps2ZeroConfUtxo(p *testParams) { log.Print("Connecting bob to lspd") p.BreezClient().Node().ConnectPeer(lsp.LightningNode()) + // Make sure everything is activated. + <-time.After(htlcInterceptorDelay) + log.Printf("Calling lsps2.get_info") info := Lsps2GetInfo(p.BreezClient(), lsp, lsps2.GetInfoRequest{ Token: &WorkingToken,