Skip to content

Commit 14137c0

Browse files
committed
Fixed flaky test
1 parent 3d4dc1f commit 14137c0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/DotNext.Tests/Net/Cluster/Consensus/Raft/StateMachine/WriteAheadLogTests.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,13 @@ public static async Task IncrementalState()
298298

299299
Memory<byte> buffer = new byte[sizeof(long)];
300300
const long count = 1000L;
301-
using var cts = new CancellationTokenSource();
302301
for (var i = 0L; i < count; i++)
303302
{
304303
BinaryPrimitives.WriteInt64LittleEndian(buffer.Span, i);
305-
306-
cts.CancelAfter(DefaultTimeout);
307-
var index = await wal.AppendAsync(buffer, token: cts.Token);
308-
await wal.CommitAsync(index, cts.Token);
309-
await wal.WaitForApplyAsync(index, cts.Token);
310304

311-
True(cts.TryReset());
305+
var index = await wal.AppendAsync(buffer);
306+
await wal.CommitAsync(index);
307+
await wal.WaitForApplyAsync(index);
312308
}
313309

314310
Equal(count * (0L + count - 1L) / 2L, stateMachine.Value);

0 commit comments

Comments
 (0)