Skip to content

Commit

Permalink
Add timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Mar 26, 2024
1 parent 4f30bf8 commit 7bc03f3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LNUnit.Tests/AbcLightningFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ public async Task<bool> IsRunning()
[Test]
[Category("Payment")]
[NonParallelizable]
[Timeout(5000)]

public async Task FailureNoRouteBecauseFeesAreTooHigh()
{
var invoice = await Builder.GeneratePaymentRequestFromAlias("carol", new Invoice
Expand All @@ -217,6 +219,7 @@ public async Task FailureNoRouteBecauseFeesAreTooHigh()
[Test]
[Category("Payment")]
[NonParallelizable]
[Timeout(5000)]
public async Task Successful()
{
var invoice = await Builder.GeneratePaymentRequestFromAlias("bob", new Invoice
Expand All @@ -236,6 +239,7 @@ public async Task Successful()
[Test]
[Category("Balancing")]
[NonParallelizable]
[Timeout(5000)]
public async Task PoolRebalance()
{
var stats = await Builder.LNDNodePool.RebalanceNodePool();
Expand All @@ -250,6 +254,7 @@ public async Task PoolRebalance()


[Test]
[Timeout(2000)]
[Category("Version")]
[NonParallelizable]
public async Task CheckLNDVersion()
Expand All @@ -262,6 +267,7 @@ public async Task CheckLNDVersion()

[Test]
[Category("ChannelAcceptor")]
[Timeout(5000)]
[NonParallelizable]
public async Task ChannelAcceptorDeny()
{
Expand Down Expand Up @@ -353,6 +359,7 @@ public async Task ChannelAcceptorDeny()
[Test]
[Category("Fees")]
[NonParallelizable]
[Timeout(60000)]
public async Task UpdateChannelPolicyPerNode()
{
var acceptorTasks = new List<LNDChannelAcceptor>();
Expand Down Expand Up @@ -410,6 +417,7 @@ public async Task UpdateChannelPolicyPerNode()
[Test]
[Category("Payment")]
[NonParallelizable]
[Timeout(5000)]
public async Task SuccessfulKeysend()
{
Builder.CancelAllInterceptors();
Expand All @@ -436,6 +444,7 @@ public async Task SuccessfulKeysend()
[Test]
[Category("LNUnit")]
[NonParallelizable]
[Timeout(5000)]
public async Task ExportGraph()
{
var data = await Builder.GetGraphFromAlias("alice");
Expand All @@ -446,6 +455,7 @@ public async Task ExportGraph()
[Test]
[Category("LNUnit")]
[NonParallelizable]
[Timeout(1000)]
public async Task GetChannelsFromAlias()
{
var alice = await Builder.GetChannelsFromAlias("alice");
Expand All @@ -465,6 +475,8 @@ public async Task GetChannelsFromAlias()
[Test]
[Category("LNUnit")]
[NonParallelizable]
[Timeout(5000)]

public async Task GetChannelPointFromAliases()
{
var data = Builder.GetChannelPointFromAliases("alice", "bob");
Expand All @@ -476,6 +488,7 @@ public async Task GetChannelPointFromAliases()
[Test]
[Category("LNDNodePool")]
[NonParallelizable]
[Timeout(1000)]
public async Task GetNodeConnectionFromPool()
{
var data = Builder.LNDNodePool.GetLNDNodeConnection();
Expand All @@ -490,6 +503,7 @@ public async Task GetNodeConnectionFromPool()
[Test]
[Category("Fees")]
[NonParallelizable]
[Timeout(5000)]
public async Task UpdateChannelPolicy()
{
var data = Builder.UpdateGlobalFeePolicyOnAlias("alice", new LNUnitNetworkDefinition.Channel());
Expand All @@ -501,6 +515,8 @@ public async Task UpdateChannelPolicy()
[Category("Payment")]
[Category("Invoice")]
[NonParallelizable]
[Timeout(5000)]

public async Task FailureInvoiceTimeout()
{
var invoice = await Builder.GeneratePaymentRequestFromAlias("alice", new Invoice
Expand Down Expand Up @@ -544,6 +560,7 @@ public async Task FailureInvoiceTimeout()
[Category("Payment")]
[Category("Interceptor")]
[NonParallelizable]
[Timeout(15000)]
public async Task FailureReasonNoRoute()
{
var invoice = await Builder.GeneratePaymentRequestFromAlias("carol", new Invoice
Expand Down Expand Up @@ -584,6 +601,7 @@ public async Task FailureReasonNoRoute()
[Category("Payment")]
[Category("Interceptor")]
[NonParallelizable]
[Timeout(30000)]
public async Task InterceptorTest()
{
List<AddInvoiceResponse> invoices = new();
Expand Down Expand Up @@ -642,6 +660,7 @@ public async Task InterceptorTest()
[Category("Payment")]
[Category("Interceptor")]
[NonParallelizable]
[Timeout(15000)]
public async Task GetPaymentFailureData()
{
//Setup
Expand Down Expand Up @@ -773,6 +792,7 @@ private async Task<string> ToAlias(LNDNodeConnection c, string remotePubkey)
[Category("Invoice")]
[Category("Sync")]
[NonParallelizable]
[Timeout(15000)]
public async Task ListInvoiceAndPaymentPaging()
{
var invoices = await Builder.GeneratePaymentsRequestFromAlias("alice", 10, new Invoice
Expand Down Expand Up @@ -830,6 +850,7 @@ public async Task ListInvoiceAndPaymentPaging()
[Category("Invoice")]
[Category("Sync")]
[NonParallelizable]
[Timeout(15000)]
public async Task ListInvoiceAndPaymentNoDatePage()
{
var invoice = await Builder.GeneratePaymentRequestFromAlias("alice", new Invoice
Expand Down

0 comments on commit 7bc03f3

Please sign in to comment.