Skip to content

Commit

Permalink
RavenDB-23298 : fix failing test - wait for counters repair task to c…
Browse files Browse the repository at this point in the history
…omplete instead of asserting the value of FixCountersLastKeySlice immediately
  • Loading branch information
aviv committed Dec 9, 2024
1 parent ba666ef commit d401403
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/SlowTests/Issues/RavenDB_22835.cs
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,16 @@ public async Task LastCounterFixedShouldBePersisted()
});

var db = await GetDatabase(store.Database);
using (db.DocumentsStorage.ContextPool.AllocateOperationContext(out DocumentsOperationContext context))
using (context.OpenReadTransaction())

Assert.True(await WaitForValueAsync(() =>
{
var lastCounterFixed = DocumentsStorage.ReadLastFixedCounterKey(context.Transaction.InnerTransaction);
Assert.Equal(CountersRepairTask.Completed, lastCounterFixed);
}
using (db.DocumentsStorage.ContextPool.AllocateOperationContext(out DocumentsOperationContext context))
using (context.OpenReadTransaction())
{
var lastCounterFixed = DocumentsStorage.ReadLastFixedCounterKey(context.Transaction.InnerTransaction);
return lastCounterFixed == CountersRepairTask.Completed;
}
}, expectedVal: true));

await ReloadDatabase(store);
db = await GetDatabase(store.Database);
Expand Down

0 comments on commit d401403

Please sign in to comment.