Skip to content

Commit 2ff9459

Browse files
committed
[debug] TestCheckpoint: show logs for arm
These tests currently time out. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent e9c6e94 commit 2ff9459

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

libcontainer/integration/checkpoint_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import (
66
"os/exec"
77
"path/filepath"
88
"regexp"
9+
"runtime"
910
"strings"
1011
"testing"
12+
"time"
1113

1214
"github.com/opencontainers/runc/libcontainer"
1315
"golang.org/x/sys/unix"
@@ -25,6 +27,27 @@ func TestCheckpoint(t *testing.T) {
2527
testCheckpoint(t, false)
2628
}
2729

30+
func showCriuLogs(t *testing.T, dir string) {
31+
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
32+
if err != nil {
33+
t.Logf("Error accessing %s: %vn", path, err)
34+
return nil
35+
}
36+
37+
if !info.IsDir() && strings.HasSuffix(info.Name(), ".log") {
38+
t.Logf("\n--- File: %s ---", path)
39+
contents, err := os.ReadFile(path)
40+
if err != nil {
41+
t.Log(err)
42+
return nil
43+
}
44+
t.Log(string(contents))
45+
}
46+
47+
return nil
48+
})
49+
}
50+
2851
func testCheckpoint(t *testing.T, userns bool) {
2952
if testing.Short() {
3053
return
@@ -79,6 +102,14 @@ func testCheckpoint(t *testing.T, userns bool) {
79102
tmp := t.TempDir()
80103
var parentImage string
81104

105+
if runtime.GOARCH == "arm64" {
106+
t.Log("setting up log retrieval")
107+
go func() {
108+
time.Sleep(20 * time.Second)
109+
showCriuLogs(t, tmp)
110+
}()
111+
}
112+
82113
// Test pre-dump if mem_dirty_track is available.
83114
if criuFeature("mem_dirty_track") {
84115
parentImage = "../criu-parent"

0 commit comments

Comments
 (0)