Skip to content

Commit

Permalink
RavenDB-22973 Make sure we wait for a thread to be completed before w…
Browse files Browse the repository at this point in the history
…e proceed with the test
  • Loading branch information
arekpalinski committed Oct 28, 2024
1 parent ab38463 commit 35250be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/SlowTests/Voron/Issues/RavenDB_22973.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ public void Must_not_omit_UpdateJournalStateUnderWriteTransactionLock_during_flu
mre.Set();
};

Thread t = null;

Env.ForTestingPurposesOnly().OnWriteTransactionCompleted += tx =>
{
if (tx == txw.LowLevelTransaction)
{
var t = new Thread(() =>
t = new Thread(() =>
{
Env.FlushLogToDataFile();
});
Expand All @@ -378,6 +380,8 @@ public void Must_not_omit_UpdateJournalStateUnderWriteTransactionLock_during_flu
Env.Journal.Applicator.ForTestingPurposesOnly().OnWaitForJournalStateToBeUpdated_AfterAssigning_updateJournalStateAfterFlush = null;
Env.ForTestingPurposesOnly().OnWriteTransactionCompleted = null;

t.Join();

using (var txw2 = Env.WriteTransaction())
{
txw2.LowLevelTransaction.AllocatePage(1);
Expand Down

0 comments on commit 35250be

Please sign in to comment.