Merge pull request #73091 from silveryfu/imagelocality-fix-test

Deflake ImageLocalityPriority integration test
This commit is contained in:
Kubernetes Prow Robot 2019-01-19 00:30:28 -08:00 committed by GitHub
commit e31ecf8251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,12 +180,6 @@ func TestImageLocality(t *testing.T) {
context := initTest(t, "image-locality")
defer cleanupTest(t, context)
// Add a few nodes.
_, err := createNodes(context.clientSet, "testnode", nil, 10)
if err != nil {
t.Fatalf("cannot create nodes: %v", err)
}
// We use a fake large image as the test image used by the pod, which has relatively large image size.
image := v1.ContainerImage{
Names: []string{
@ -194,12 +188,18 @@ func TestImageLocality(t *testing.T) {
SizeBytes: 3000 * 1024 * 1024,
}
// Create a node with the large image
// Create a node with the large image.
nodeWithLargeImage, err := createNodeWithImages(context.clientSet, "testnode-large-image", nil, []v1.ContainerImage{image})
if err != nil {
t.Fatalf("cannot create node with a large image: %v", err)
}
// Add a few nodes.
_, err = createNodes(context.clientSet, "testnode", nil, 10)
if err != nil {
t.Fatalf("cannot create nodes: %v", err)
}
// Create a pod with containers each having the specified image.
podName := "pod-using-large-image"
pod, err := runPodWithContainers(context.clientSet, initPodWithContainers(context.clientSet, &podWithContainersConfig{