Skip to content

Commit 56f2388

Browse files
committed
Log containers
1 parent 7580984 commit 56f2388

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

build/devenv/tests/e2e/load_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ func TestE2ELoad(t *testing.T) {
271271
// Initialize Prometheus helper
272272
promHelper, err := NewPrometheusHelper(os.Getenv("PROM_URL"), *zerolog.Ctx(ctx))
273273
require.NoError(t, err)
274+
PrintRunningContainers(t)
274275
t.Run("clean", func(t *testing.T) {
275276
rps := int64(1)
276277
testDuration := 30 * time.Second

build/devenv/tests/e2e/test_helpers.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/hex"
66
"fmt"
77
"os"
8+
"os/exec"
89
"testing"
910
"time"
1011

@@ -374,3 +375,18 @@ func (p *PrometheusHelper) GetCurrentCounter(
374375

375376
return value, nil
376377
}
378+
379+
// PrintRunningContainers prints all running Docker containers for debugging purposes.
380+
// This is useful for CI debugging to understand the container state.
381+
func PrintRunningContainers(t *testing.T) {
382+
t.Helper()
383+
384+
cmd := exec.Command("docker", "ps", "--format", "table {{.Names}}\t{{.Status}}\t{{.Ports}}")
385+
output, err := cmd.CombinedOutput()
386+
if err != nil {
387+
t.Logf("Warning: failed to list Docker containers: %v", err)
388+
return
389+
}
390+
391+
t.Logf("Docker containers currently running:\n%s", string(output))
392+
}

0 commit comments

Comments
 (0)