From a05f7e08eb427af28c7ac5f37ddc0bb9b8db9f33 Mon Sep 17 00:00:00 2001
From: Brett Smith <brett.smith@curii.com>
Date: Fri, 5 May 2023 09:49:04 -0400
Subject: [PATCH] 12684: Check for no log case in controller integration tests

Without this guard, tests fail with a message "API endpoint not found,"
which sounds scary and makes you think you broke all of Arvados until
you see the test code is just looking up a collection with an empty
UUID.

And by "you," I mean me.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>
---
 lib/controller/integration_test.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index e207e669c8..dc43c61a23 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -1241,7 +1241,11 @@ func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, token stri
 		} else {
 			if time.Now().After(deadline) {
 				c.Errorf("timed out, container state is %q", cr.State)
-				showlogs(ctr.Log)
+				if ctr.Log == "" {
+					c.Logf("=== NO LOG COLLECTION saved for container")
+				} else {
+					showlogs(ctr.Log)
+				}
 				c.FailNow()
 			}
 			time.Sleep(time.Second / 2)
-- 
2.30.2