Skip to content

Commit

Permalink
RavenDB-22225 avoid opening write tx in the same test thread
Browse files Browse the repository at this point in the history
  • Loading branch information
karmeli87 committed May 7, 2024
1 parent e122a90 commit 6e3ea74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/RachisTests/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Raven.Server.ServerWide.Context;
using Sparrow.Json;
using Sparrow.Server;
using Sparrow.Utils;
using Tests.Infrastructure;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -63,9 +64,13 @@ public async Task RavenDB_13659()
var leader = await CreateNetworkAndGetLeader(1);
var mre = new AsyncManualResetEvent();
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
var currentThread = NativeMemory.CurrentThreadStats.ManagedThreadId;

leader.Timeout.Start(() =>
{
if (currentThread == NativeMemory.CurrentThreadStats.ManagedThreadId)
throw new InvalidOperationException("Can't use same thread as the xUnit test");
mre.Set();
try
{
Expand Down

0 comments on commit 6e3ea74

Please sign in to comment.