Run unreliable tests, attempt to make them a bit more reliable

This commit is contained in:
nicolas.dorier 2018-10-28 22:10:37 +09:00
parent 6aa84326af
commit 4625ff92f1
3 changed files with 16 additions and 0 deletions

View File

@ -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:

View File

@ -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<NBXplorerDashboard>();
while (!dashboard.IsFullySynched(cryptoCode, out var unused))
{
Thread.Sleep(10);
cts.Token.ThrowIfCancellationRequested();
}
}
}
}
}

View File

@ -410,6 +410,7 @@ namespace BTCPayServer.Tests
Assert.IsType<ViewResult>(storeController.UpdateStore());
Assert.IsType<ViewResult>(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,