From 86e1ed8a9e918a942098cbd01188c0a6a8acd925 Mon Sep 17 00:00:00 2001 From: Swagat Bora Date: Wed, 25 Sep 2024 22:18:57 +0000 Subject: [PATCH] add logs to debug flaky test Signed-off-by: Swagat Bora --- runtime/service_integ_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/service_integ_test.go b/runtime/service_integ_test.go index 122d9c9a9..327ce029b 100644 --- a/runtime/service_integ_test.go +++ b/runtime/service_integ_test.go @@ -946,6 +946,12 @@ func startAndWaitTask(ctx context.Context, t testing.TB, c containerd.Container) assert.NoError(t, exitStatus.Error(), "failed to retrieve exitStatus") assert.Equal(t, uint32(0), exitStatus.ExitCode()) + // Print anything on stderr to help with debugging + stderrOutput := stderr.String() + if len(stderrOutput) != 0 { + fmt.Printf("stderr output from container %s: %s", c.ID(), stderrOutput) + } + status, err := task.Delete(ctx) assert.NoErrorf(t, err, "failed to delete task %q after exit", c.ID()) if status != nil {