diff --git a/.circleci/config.yml b/.circleci/config.yml index 717f8d5a6..52d7411ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,7 @@ jobs: dotnet test --filter Fast=Fast docker-compose up -d dev dotnet test --filter Reliable=Reliable + dotnet test --filter Unreliable=Unreliable workflows: version: 2 build_and_test: diff --git a/BTCPayServer.Tests/BTCPayServerTester.cs b/BTCPayServer.Tests/BTCPayServerTester.cs index a881e35fe..bfb8c27a1 100644 --- a/BTCPayServer.Tests/BTCPayServerTester.cs +++ b/BTCPayServer.Tests/BTCPayServerTester.cs @@ -1,4 +1,5 @@ using BTCPayServer.Configuration; +using BTCPayServer.HostedServices; using BTCPayServer.Hosting; using BTCPayServer.Payments; using BTCPayServer.Payments.Lightning; @@ -255,5 +256,18 @@ namespace BTCPayServer.Tests if (_Host != null) _Host.Dispose(); } + + public void WaitFullNodeAvailable(string cryptoCode) + { + using (var cts = new CancellationTokenSource(5000)) + { + var dashboard = GetService(); + while (!dashboard.IsFullySynched(cryptoCode, out var unused)) + { + Thread.Sleep(10); + cts.Token.ThrowIfCancellationRequested(); + } + } + } } } diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index 41aa01d25..da0006093 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -410,6 +410,7 @@ namespace BTCPayServer.Tests Assert.IsType(storeController.UpdateStore()); Assert.IsType(storeController.AddLightningNode(user.StoreId, "BTC")); + tester.PayTester.WaitFullNodeAvailable("BTC"); var testResult = storeController.AddLightningNode(user.StoreId, new LightningNodeViewModel() { ConnectionString = "type=charge;server=" + tester.MerchantCharge.Client.Uri.AbsoluteUri,