Skip to content

Commit

Permalink
RavenDB-23104 - print idle explanation in test
Browse files Browse the repository at this point in the history
  • Loading branch information
garayx committed Dec 16, 2024
1 parent b08e207 commit d8751d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/SlowTests/Server/Replication/PullReplicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,22 @@ public async Task PullReplicationAsSinkToHubWithIdleShouldWork()

var now = DateTime.Now;
var nextNow = now + TimeSpan.FromSeconds(60);

var statistics = new IdleDatabaseStatistics
{
Name = hub.Database.ToString()
};

while (now < nextNow && hubServer.ServerStore.IdleDatabases.Count < 1)
{
await Task.Delay(1000);
var hubDb = hubServer.ServerStore.DatabasesLandlord.LastRecentlyUsed.FirstOrDefault();
hubServer.ServerStore.CanUnloadDatabase(hubDb.Key, hubDb.Value, statistics, out _);

now = DateTime.Now;
}

Assert.Equal(1, hubServer.ServerStore.IdleDatabases.Count);
Assert.True(1 == hubServer.ServerStore.IdleDatabases.Count, string.Join(Environment.NewLine, statistics.Explanations));
Assert.Equal(0, sinkServer.ServerStore.IdleDatabases.Count);

var sinkDb = await GetDatabase(sinkServer, sink.Database);
Expand Down

0 comments on commit d8751d0

Please sign in to comment.