Skip to content

Commit c775aaa

Browse files
committed
add more details if serve-static does not become healthy
1 parent e37dbfd commit c775aaa

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests-integration/Elastic.Assembler.IntegrationTests/AssembleFixture.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,18 @@ public async ValueTask InitializeAsync()
5353

5454
await ValidateExitCode(AssemblerBuild);
5555

56-
_ = await DistributedApplication.ResourceNotifications
57-
.WaitForResourceHealthyAsync(AssemblerServe, cancellationToken: TestContext.Current.CancellationToken)
58-
.WaitAsync(TimeSpan.FromMinutes(1), TestContext.Current.CancellationToken);
56+
try
57+
{
58+
_ = await DistributedApplication.ResourceNotifications
59+
.WaitForResourceHealthyAsync(AssemblerServe, cancellationToken: TestContext.Current.CancellationToken)
60+
.WaitAsync(TimeSpan.FromMinutes(1), TestContext.Current.CancellationToken);
61+
}
62+
catch (Exception e)
63+
{
64+
await DistributedApplication.StopAsync();
65+
await DistributedApplication.DisposeAsync();
66+
throw new Exception($"{e.Message}: {string.Join(Environment.NewLine, InMemoryLogger.RecordedLogs.Reverse().Take(30).Reverse())}", e);
67+
}
5968
}
6069

6170
private async ValueTask ValidateExitCode(string resourceName)

0 commit comments

Comments
 (0)