Skip to content

Commit e7a46cc

Browse files
authored
Add a pause type command to windows nanoserver and server containers in e2e tests (#7104)
1 parent 742d0b9 commit e7a46cc

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

e2e/kube.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,11 @@ func podWindows(s *Scenario, podName string, imageName string) *corev1.Pod {
521521
Spec: corev1.PodSpec{
522522
Containers: []corev1.Container{
523523
{
524-
Name: podName,
525-
Image: imageName,
524+
Name: podName,
525+
Image: imageName,
526+
ImagePullPolicy: "IfNotPresent",
527+
// this should exist on both servercore and nanoserve
528+
Command: []string{"cmd", "/c", "ping", "-t", "localhost"},
526529
},
527530
},
528531
NodeSelector: map[string]string{

e2e/validation.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e
33
import (
44
"context"
55
"encoding/base64"
6+
"encoding/json"
67
"fmt"
78
"strings"
89
"testing"
@@ -34,7 +35,13 @@ func ValidatePodRunning(ctx context.Context, s *Scenario, pod *corev1.Pod) {
3435
})
3536

3637
_, err = kube.WaitUntilPodRunning(ctx, pod.Namespace, "", "metadata.name="+pod.Name)
37-
require.NoErrorf(s.T, err, "failed to wait for pod %q to be in running state", pod.Name)
38+
if err != nil {
39+
jsonString, jsonError := json.Marshal(pod)
40+
if jsonError != nil {
41+
jsonString = []byte(jsonError.Error())
42+
}
43+
require.NoErrorf(s.T, err, "failed to wait for pod %q to be in running state. Pod data: %s", pod.Name, jsonString)
44+
}
3845

3946
timeForReady := time.Since(start)
4047
toolkit.LogDuration(ctx, timeForReady, time.Minute, fmt.Sprintf("Time for pod %q to get ready was %s", pod.Name, timeForReady))

0 commit comments

Comments
 (0)