Merge pull request #8023 from fuweid/fix-7965

deflake: TestContainerPids
This commit is contained in:
Fu Wei 2023-01-29 19:00:09 +08:00 committed by GitHub
commit aef75c4183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -30,7 +30,19 @@ var (
testImage = images.Get(images.BusyBox)
testMultiLayeredImage = images.Get(images.VolumeCopyUp)
shortCommand = withProcessArgs("true")
longCommand = withProcessArgs("/bin/sh", "-c", "while true; do sleep 1; done")
// NOTE: The TestContainerPids needs two running processes in one
// container. But busybox:1.36 sh shell, the `sleep` is a builtin.
//
// /bin/sh -c "type sleep"
// sleep is a shell builtin
//
// We should use `/bin/sleep` instead of `sleep`. And busybox sh shell
// will execve directly instead of clone-execve if there is only one
// command. There will be only one process in container if we use
// '/bin/sh -c "/bin/sleep inf"'.
//
// So we append `&& exit 0` to force sh shell uses clone-execve.
longCommand = withProcessArgs("/bin/sh", "-c", "/bin/sleep inf && exit 0")
)
func TestImagePullSchema1WithEmptyLayers(t *testing.T) {

View File

@ -48,7 +48,7 @@ var initOnce sync.Once
func initImages(imageListFile string) {
imageList = ImageList{
Alpine: "ghcr.io/containerd/alpine:3.14.0",
BusyBox: "ghcr.io/containerd/busybox:1.28",
BusyBox: "ghcr.io/containerd/busybox:1.36",
Pause: "registry.k8s.io/pause:3.8",
ResourceConsumer: "registry.k8s.io/e2e-test-images/resource-consumer:1.10",
VolumeCopyUp: "ghcr.io/containerd/volume-copy-up:2.1",