(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestReload100Pods(t *testing.T) { |
| 85 | workDir := t.TempDir() |
| 86 | |
| 87 | currentReleaseCtrdDefaultConfig(t, workDir) |
| 88 | |
| 89 | ctrd := newCtrdProc(t, *containerdBin, workDir, []string{}) |
| 90 | |
| 91 | logPath := ctrd.logPath() |
| 92 | t.Cleanup(func() { |
| 93 | if t.Failed() { |
| 94 | dumpFileContent(t, logPath) |
| 95 | } |
| 96 | |
| 97 | t.Log("Ensure there is no leaky state dir after test") |
| 98 | assert.NoError(t, os.Remove(filepath.Join(workDir, "state", "io.containerd.runtime.v2.task", "k8s.io"))) |
| 99 | }) |
| 100 | require.NoError(t, ctrd.isReady()) |
| 101 | |
| 102 | podCtxs := []*podTCtx{} |
| 103 | defer func() { |
| 104 | for _, p := range podCtxs { |
| 105 | p.stop(true) |
| 106 | } |
| 107 | assert.NoError(t, ctrd.kill(syscall.SIGTERM)) |
| 108 | assert.NoError(t, ctrd.wait(5*time.Minute)) |
| 109 | }() |
| 110 | |
| 111 | for i := range 100 { |
| 112 | podCtx := newPodTCtx(t, |
| 113 | ctrd.criRuntimeService(t), |
| 114 | fmt.Sprintf("test-restart-%d", i), |
| 115 | "sandbox", |
| 116 | WithHostNetwork) |
| 117 | |
| 118 | podCtxs = append(podCtxs, podCtx) |
| 119 | } |
| 120 | |
| 121 | assert.NoError(t, ctrd.kill(syscall.SIGTERM)) |
| 122 | assert.NoError(t, ctrd.wait(5*time.Minute)) |
| 123 | |
| 124 | ctrd = newCtrdProc(t, *containerdBin, workDir, []string{}) |
| 125 | require.NoError(t, ctrd.isReady()) |
| 126 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…