Renaming Timeout to TestTimeout, async/await TriggerAndWaitRoundAsync
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepOutputRegistrationTests.cs
@@ -18,12 +18,12 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping;
public class StepOutputRegistrationTests
{
- private TimeSpan Timeout { get; } = TimeSpan.FromMinutes(3);
+ private TimeSpan TestTimeout { get; } = TimeSpan.FromMinutes(3);
[Fact]
public async Task AllBobsRegisteredAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -72,7 +72,7 @@ public class StepOutputRegistrationTests
[Fact]
public async Task SomeBobsRegisteredTimeoutAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -112,7 +112,7 @@ public class StepOutputRegistrationTests
[Fact]
public async Task DiffTooSmallToBlameAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -167,7 +167,7 @@ public class StepOutputRegistrationTests
[Fact]
public async Task DoesntSwitchImmaturelyAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -201,7 +201,7 @@ public class StepOutputRegistrationTests
private async Task<(Round Round, ArenaClient ArenaClient, AliceClient[] alices)>
CreateRoundWithTwoConfirmedConnectionsAsync(Arena arena, IKeyChain keyChain, SmartCoin coin1, SmartCoin coin2)
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
// Get the round.

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
@@ -21,12 +21,12 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping;
public class StepTransactionSigningTests
{
- private TimeSpan Timeout { get; } = TimeSpan.FromMinutes(3);
+ private TimeSpan TestTimeout { get; } = TimeSpan.FromMinutes(3);
[Fact]
public async Task EveryoneSignedAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -61,7 +61,7 @@ public class StepTransactionSigningTests
[Fact]
public async Task FailsBroadcastAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -102,7 +102,7 @@ public class StepTransactionSigningTests
[Fact]
public async Task AlicesSpentAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -149,7 +149,7 @@ public class StepTransactionSigningTests
[Fact]
public async Task TimeoutInsufficientPeersAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -190,7 +190,7 @@ public class StepTransactionSigningTests
[Fact]
public async Task TimeoutSufficientPeersAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
WabiSabiConfig cfg = new()
@@ -246,7 +246,7 @@ public class StepTransactionSigningTests
private async Task<(Round Round, AliceClient AliceClient1, AliceClient AliceClient2)>
CreateRoundWithOutputsReadyToSignAsync(Arena arena, IKeyChain keyChain, SmartCoin coin1, SmartCoin coin2)
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
// Create the round.

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
@@ -22,12 +22,12 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Client;
public class BobClientTests
{
- private TimeSpan Timeout { get; } = TimeSpan.FromMinutes(3);
+ private TimeSpan TestTimeout { get; } = TimeSpan.FromMinutes(3);
[Fact]
public async Task RegisterOutputTestAsync()
{
- using CancellationTokenSource cancellationTokenSource = new(Timeout);
+ using CancellationTokenSource cancellationTokenSource = new(TestTimeout);
var token = cancellationTokenSource.Token;
var config = new WabiSabiConfig { MaxInputCountByRound = 1 };

MODIFY
WalletWasabi/Bases/PeriodicRunner.cs
WalletWasabi/Bases/PeriodicRunner.cs
@@ -56,10 +56,10 @@ public abstract class PeriodicRunner : BackgroundService
await eventAwaiter.WaitAsync(token).ConfigureAwait(false);
}
- public Task TriggerAndWaitRoundAsync(TimeSpan timeout)
+ public async Task TriggerAndWaitRoundAsync(TimeSpan timeout)
{
using CancellationTokenSource cancellationTokenSource = new(timeout);
- return TriggerAndWaitRoundAsync(cancellationTokenSource.Token);
+ await TriggerAndWaitRoundAsync(cancellationTokenSource.Token).ConfigureAwait(false);
}
/// <summary>

Renaming Timeout to TestTimeout, async/await TriggerAndWaitRoundAsync