From 771a952f0255cdcdd2a1176b2919c999f4bf6386 Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 4 Aug 2023 08:19:03 +0200 Subject: [PATCH] Download container logs when EnsureOnline fails --- DistTestCore/CodexStarter.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/DistTestCore/CodexStarter.cs b/DistTestCore/CodexStarter.cs index 23b60b11..4c40a068 100644 --- a/DistTestCore/CodexStarter.cs +++ b/DistTestCore/CodexStarter.cs @@ -93,10 +93,26 @@ namespace DistTestCore { var group = new CodexNodeGroup(lifecycle, codexSetup, runningContainers, codexNodeFactory); RunningGroups.Add(group); - Stopwatch.Measure(lifecycle.Log, "EnsureOnline", group.EnsureOnline, debug: true); + + try + { + Stopwatch.Measure(lifecycle.Log, "EnsureOnline", group.EnsureOnline, debug: true); + } + catch + { + CodexNodesNotOnline(runningContainers); + throw; + } + return group; } + private void CodexNodesNotOnline(RunningContainers runningContainers) + { + Log("Codex nodes failed to start"); + foreach (var container in runningContainers.Containers) lifecycle.DownloadLog(container); + } + private StartupWorkflow CreateWorkflow() { return workflowCreator.CreateWorkflow();