Skip to content

Commit

Permalink
add logs to debug flaky test
Browse files Browse the repository at this point in the history
Signed-off-by: Swagat Bora <[email protected]>
  • Loading branch information
swagatbora90 committed Sep 25, 2024
1 parent 81c6e22 commit 86e1ed8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/service_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 86e1ed8

Please sign in to comment.