diff --git a/test/SlowTests/Server/Documents/OngoingTasks/PinOnGoingTaskToMentorNode.cs b/test/SlowTests/Server/Documents/OngoingTasks/PinOnGoingTaskToMentorNode.cs index 7a1a323ac04d..a9ec20605c90 100644 --- a/test/SlowTests/Server/Documents/OngoingTasks/PinOnGoingTaskToMentorNode.cs +++ b/test/SlowTests/Server/Documents/OngoingTasks/PinOnGoingTaskToMentorNode.cs @@ -262,7 +262,8 @@ await WaitForValueAsync(async () => return ongoingTask.ResponsibleNode.NodeTag != responsibleNodeNodeTag; }, true); - Assert.True(WaitForDocument(dest, "users/2", u => u.Name == "Joe Doe2")); + Assert.True(WaitForDocument(dest, "users/2", u => u.Name == "Joe Doe2", timeout: 30_000), + userMessage: await Etl.GetEtlDebugInfo(src.Database, server: srcRaft.Nodes.Single(s => s.ServerStore.NodeTag == ongoingTask.ResponsibleNode.NodeTag))); } } diff --git a/test/Tests.Infrastructure/RavenTestBase.Etl.cs b/test/Tests.Infrastructure/RavenTestBase.Etl.cs index ad7782497a84..bc4cdc73282b 100644 --- a/test/Tests.Infrastructure/RavenTestBase.Etl.cs +++ b/test/Tests.Infrastructure/RavenTestBase.Etl.cs @@ -33,6 +33,7 @@ using System.Text; using Newtonsoft.Json; using Raven.Client.Util; +using Raven.Server; using Tests.Infrastructure; namespace FastTests @@ -321,16 +322,16 @@ public async Task GetDatabaseFor(IDocumentStore store, string return await _parent.GetDocumentDatabaseInstanceFor(store, databaseName); } - public async Task GetEtlDebugInfo(string database, TimeSpan timeout, RavenDatabaseMode databaseMode = RavenDatabaseMode.Single) + public async Task GetEtlDebugInfo(string database, TimeSpan? timeout = null, RavenDatabaseMode databaseMode = RavenDatabaseMode.Single, RavenServer server = null) { IEnumerable databases = databaseMode switch { - RavenDatabaseMode.Single => new[] { await _parent.GetDatabase(database) }, - RavenDatabaseMode.Sharded => await _parent.Sharding.GetShardsDocumentDatabaseInstancesFor(database).ToListAsync(), + RavenDatabaseMode.Single => new[] { await GetDatabase(server ?? _parent.Server, database) }, + RavenDatabaseMode.Sharded => await _parent.Sharding.GetShardsDocumentDatabaseInstancesFor(database, server == null ? null : [server]).ToListAsync(), _ => throw new ArgumentOutOfRangeException(nameof(databaseMode), databaseMode, null) }; - var sb = new StringBuilder($"ETL did not finish in {timeout.TotalSeconds} seconds."); + var sb = new StringBuilder($"ETL did not finish in {timeout?.TotalSeconds ?? 30} seconds."); foreach (var documentDatabase in databases) {