Skip to content

Commit fa2dfed

Browse files
Merge pull request #19629 from adambkaplan/bugfix/imagestream-test-flakes
Relaxing docker image source extended test
2 parents 72c9740 + 8047bab commit fa2dfed

File tree

17 files changed

+59
-55
lines changed

17 files changed

+59
-55
lines changed

test/extended/builds/contextdir.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var _ = g.Describe("[Feature:Builds][Slow] builds with a context directory", fun
5656
o.Expect(err).NotTo(o.HaveOccurred())
5757

5858
g.By("waiting for build to finish")
59-
err = exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), s2iBuildName, exutil.CheckBuildSuccessFn, exutil.CheckBuildFailedFn, nil)
59+
err = exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), s2iBuildName, exutil.CheckBuildSuccess, exutil.CheckBuildFailed, nil)
6060
if err != nil {
6161
exutil.DumpBuildLogs("s2icontext", oc)
6262
}
@@ -73,7 +73,7 @@ var _ = g.Describe("[Feature:Builds][Slow] builds with a context directory", fun
7373
o.Expect(err).NotTo(o.HaveOccurred())
7474

7575
assertPageContent := func(content string) {
76-
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunningFn, 1, 2*time.Minute)
76+
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 2*time.Minute)
7777
o.Expect(err).NotTo(o.HaveOccurred())
7878

7979
result, err := imageeco.CheckPageContains(oc, "frontend", "", content)
@@ -112,7 +112,7 @@ var _ = g.Describe("[Feature:Builds][Slow] builds with a context directory", fun
112112

113113
// build will fail if we don't use the right context dir because there won't be a dockerfile present.
114114
g.By("waiting for build to finish")
115-
err = exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), dockerBuildName, exutil.CheckBuildSuccessFn, exutil.CheckBuildFailedFn, nil)
115+
err = exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), dockerBuildName, exutil.CheckBuildSuccess, exutil.CheckBuildFailed, nil)
116116
if err != nil {
117117
exutil.DumpBuildLogs("dockercontext", oc)
118118
}

test/extended/builds/image_source.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
o "github.com/onsi/gomega"
88
"k8s.io/kubernetes/pkg/api/legacyscheme"
99

10-
kapiv1 "k8s.io/api/core/v1"
1110
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1211

1312
buildapi "github.com/openshift/origin/pkg/build/apis/build"
@@ -40,7 +39,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
4039
o.Expect(err).NotTo(o.HaveOccurred())
4140

4241
g.By("waiting for imagestreams to be imported")
43-
err = exutil.WaitForAnImageStream(oc.AdminImageClient().Image().ImageStreams("openshift"), "ruby", exutil.CheckImageStreamLatestTagPopulatedFn, exutil.CheckImageStreamTagNotFoundFn)
42+
err = exutil.WaitForAnImageStream(oc.AdminImageClient().Image().ImageStreams("openshift"), "ruby", exutil.CheckImageStreamLatestTagPopulated, exutil.CheckImageStreamTagNotFound)
4443
o.Expect(err).NotTo(o.HaveOccurred())
4544
})
4645

@@ -66,7 +65,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
6665
br.AssertSuccess()
6766

6867
g.By("expecting the pod to deploy successfully")
69-
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), imageSourceLabel, exutil.CheckPodIsRunningFn, 1, 2*time.Minute)
68+
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), imageSourceLabel, exutil.CheckPodIsRunning, 1, 2*time.Minute)
7069
o.Expect(err).NotTo(o.HaveOccurred())
7170
o.Expect(len(pods)).To(o.Equal(1))
7271
pod, err := oc.KubeClient().Core().Pods(oc.Namespace()).Get(pods[0], metav1.GetOptions{})
@@ -93,7 +92,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
9392
br.AssertSuccess()
9493

9594
g.By("expect the pod to deploy successfully")
96-
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), imageDockerLabel, exutil.CheckPodIsRunningFn, 1, 2*time.Minute)
95+
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), imageDockerLabel, exutil.CheckPodIsRunning, 1, 2*time.Minute)
9796
o.Expect(err).NotTo(o.HaveOccurred())
9897
o.Expect(len(pods)).To(o.Equal(1))
9998
pod, err := oc.KubeClient().Core().Pods(oc.Namespace()).Get(pods[0], metav1.GetOptions{})
@@ -119,8 +118,8 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
119118
err = oc.Run("create").Args("-f", s2iBuildFixture).Execute()
120119
o.Expect(err).NotTo(o.HaveOccurred())
121120

122-
g.By("expecting the build pod to start running")
123-
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), sourceBuildLabel, exutil.CheckPodIsRunningFn, 1, 2*time.Minute)
121+
g.By("expecting the build pod to exist")
122+
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), sourceBuildLabel, exutil.CheckPodNoOp, 1, 2*time.Minute)
124123
o.Expect(err).NotTo(o.HaveOccurred())
125124
o.Expect(len(pods)).To(o.Equal(1))
126125
pod, err := oc.KubeClient().Core().Pods(oc.Namespace()).Get(pods[0], metav1.GetOptions{})
@@ -165,8 +164,8 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
165164
err = oc.Run("create").Args("-f", dockerBuildFixture).Execute()
166165
o.Expect(err).NotTo(o.HaveOccurred())
167166

168-
g.By("expecting the build pod to start running")
169-
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dockerBuildLabel, exutil.CheckPodIsRunningFn, 1, 2*time.Minute)
167+
g.By("expecting the build pod to exist")
168+
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dockerBuildLabel, exutil.CheckPodNoOp, 1, 2*time.Minute)
170169
o.Expect(err).NotTo(o.HaveOccurred())
171170
o.Expect(len(pods)).To(o.Equal(1))
172171
pod, err := oc.KubeClient().Core().Pods(oc.Namespace()).Get(pods[0], metav1.GetOptions{})
@@ -212,7 +211,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have Docker image source",
212211
o.Expect(err).NotTo(o.HaveOccurred())
213212

214213
g.By("expecting the build pod to exist")
215-
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), customBuildLabel, func(kapiv1.Pod) bool { return true }, 1, 2*time.Minute)
214+
pods, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), customBuildLabel, exutil.CheckPodNoOp, 1, 2*time.Minute)
216215
o.Expect(err).NotTo(o.HaveOccurred())
217216
o.Expect(len(pods)).To(o.Equal(1))
218217
pod, err := oc.KubeClient().Core().Pods(oc.Namespace()).Get(pods[0], metav1.GetOptions{})

test/extended/builds/pipeline.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
882882
case err != nil:
883883
errs <- fmt.Errorf("error getting build: %s", err)
884884
return
885-
case exutil.CheckBuildFailedFn(build):
885+
case exutil.CheckBuildFailed(build):
886886
errs <- nil
887887
return
888-
case exutil.CheckBuildSuccessFn(build):
888+
case exutil.CheckBuildSuccess(build):
889889
br.BuildSuccess = true
890890
errs <- nil
891891
return

test/extended/builds/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
266266
build := &buildapi.Build{}
267267
cancelFn := func(b *buildapi.Build) bool {
268268
build = b
269-
return exutil.CheckBuildCancelledFn(b)
269+
return exutil.CheckBuildCancelled(b)
270270
}
271271
err := exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), "sample-build-binary-invalidnodeselector-1", nil, nil, cancelFn)
272272
o.Expect(err).NotTo(o.HaveOccurred())

test/extended/cluster/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func CreatePods(c kclientset.Interface, appName string, ns string, labels map[st
116116
// If a stepping tuningset has been defined in the config, we wait for the step of pods to be created, and pause
117117
if tuning.Pods.Stepping.StepSize != 0 && (i+1)%tuning.Pods.Stepping.StepSize == 0 {
118118
framework.Logf("Waiting for pods created this step to be running")
119-
pods, err := exutil.WaitForPods(c.CoreV1().Pods(ns), exutil.ParseLabelsOrDie(mapToString(labels)), exutil.CheckPodIsRunningFn, i+1, tuning.Pods.Stepping.Timeout*time.Second)
119+
pods, err := exutil.WaitForPods(c.CoreV1().Pods(ns), exutil.ParseLabelsOrDie(mapToString(labels)), exutil.CheckPodIsRunning, i+1, tuning.Pods.Stepping.Timeout*time.Second)
120120
if err != nil {
121121
framework.Failf("Error in wait... %v", err)
122122
} else if len(pods) < i+1 {

test/extended/image_ecosystem/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
// RunInPodContainer will run provided command in the specified pod container.
1717
func RunInPodContainer(oc *exutil.CLI, selector labels.Selector, cmd []string) error {
18-
pods, err := exutil.WaitForPods(oc.KubeClient().CoreV1().Pods(oc.Namespace()), selector, exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
18+
pods, err := exutil.WaitForPods(oc.KubeClient().CoreV1().Pods(oc.Namespace()), selector, exutil.CheckPodIsRunning, 1, 4*time.Minute)
1919
if err != nil {
2020
return err
2121
}

test/extended/image_ecosystem/mongodb_ephemeral.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var _ = g.Describe("[image_ecosystem][mongodb] openshift mongodb image", func()
4545
podNames, err := exutil.WaitForPods(
4646
oc.KubeClient().Core().Pods(oc.Namespace()),
4747
exutil.ParseLabelsOrDie("name=mongodb"),
48-
exutil.CheckPodIsRunningFn,
48+
exutil.CheckPodIsRunning,
4949
1,
5050
4*time.Minute,
5151
)

test/extended/image_ecosystem/mongodb_replica_statefulset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var _ = g.Describe("[Conformance][image_ecosystem][mongodb][Slow] openshift mong
6868
podNames, err := exutil.WaitForPods(
6969
oc.KubeClient().Core().Pods(oc.Namespace()),
7070
exutil.ParseLabelsOrDie("name=mongodb-replicaset"),
71-
exutil.CheckPodIsReadyFn,
71+
exutil.CheckPodIsReady,
7272
3,
7373
8*time.Minute,
7474
)
@@ -110,7 +110,7 @@ var _ = g.Describe("[Conformance][image_ecosystem][mongodb][Slow] openshift mong
110110
podNames, err = exutil.WaitForPods(
111111
oc.KubeClient().Core().Pods(oc.Namespace()),
112112
exutil.ParseLabelsOrDie("name=mongodb-replicaset"),
113-
exutil.CheckPodIsReadyFn,
113+
exutil.CheckPodIsReady,
114114
3,
115115
4*time.Minute,
116116
)

test/extended/image_ecosystem/mysql_replica.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ var (
4040
// CreateMySQLReplicationHelpers creates a set of MySQL helpers for master,
4141
// slave and an extra helper that is used for remote login test.
4242
func CreateMySQLReplicationHelpers(c kcoreclient.PodInterface, masterDeployment, slaveDeployment, helperDeployment string, slaveCount int) (exutil.Database, []exutil.Database, exutil.Database) {
43-
podNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", masterDeployment)), exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
43+
podNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", masterDeployment)), exutil.CheckPodIsRunning, 1, 4*time.Minute)
4444
o.Expect(err).NotTo(o.HaveOccurred())
4545
masterPod := podNames[0]
4646

47-
slavePods, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", slaveDeployment)), exutil.CheckPodIsRunningFn, slaveCount, 6*time.Minute)
47+
slavePods, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", slaveDeployment)), exutil.CheckPodIsRunning, slaveCount, 6*time.Minute)
4848
o.Expect(err).NotTo(o.HaveOccurred())
4949

5050
// Create MySQL helper for master
@@ -57,7 +57,7 @@ func CreateMySQLReplicationHelpers(c kcoreclient.PodInterface, masterDeployment,
5757
slaves[i] = slave
5858
}
5959

60-
helperNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", helperDeployment)), exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
60+
helperNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", helperDeployment)), exutil.CheckPodIsRunning, 1, 4*time.Minute)
6161
o.Expect(err).NotTo(o.HaveOccurred())
6262
helper := db.NewMysql(helperNames[0], masterPod)
6363

test/extended/image_ecosystem/postgresql_replica.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ var _ = g.Describe("[image_ecosystem][postgresql][Slow][local] openshift postgre
6060
// CreatePostgreSQLReplicationHelpers creates a set of PostgreSQL helpers for master,
6161
// slave an en extra helper that is used for remote login test.
6262
func CreatePostgreSQLReplicationHelpers(c kcoreclient.PodInterface, masterDeployment, slaveDeployment, helperDeployment string, slaveCount int) (exutil.Database, []exutil.Database, exutil.Database) {
63-
podNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", masterDeployment)), exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
63+
podNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", masterDeployment)), exutil.CheckPodIsRunning, 1, 4*time.Minute)
6464
o.Expect(err).NotTo(o.HaveOccurred())
6565
masterPod := podNames[0]
6666

67-
slavePods, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", slaveDeployment)), exutil.CheckPodIsRunningFn, slaveCount, 6*time.Minute)
67+
slavePods, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", slaveDeployment)), exutil.CheckPodIsRunning, slaveCount, 6*time.Minute)
6868
o.Expect(err).NotTo(o.HaveOccurred())
6969

7070
// Create PostgreSQL helper for master
@@ -77,7 +77,7 @@ func CreatePostgreSQLReplicationHelpers(c kcoreclient.PodInterface, masterDeploy
7777
slaves[i] = slave
7878
}
7979

80-
helperNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", helperDeployment)), exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
80+
helperNames, err := exutil.WaitForPods(c, exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", helperDeployment)), exutil.CheckPodIsRunning, 1, 4*time.Minute)
8181
o.Expect(err).NotTo(o.HaveOccurred())
8282
helper := db.NewPostgreSQL(helperNames[0], masterPod)
8383

test/extended/image_ecosystem/s2i_perl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var _ = g.Describe("[image_ecosystem][perl][Slow] hot deploy for openshift perl
7272
o.Expect(err).NotTo(o.HaveOccurred())
7373

7474
checkPage := func(expected string, dcLabel labels.Selector) {
75-
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
75+
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 4*time.Minute)
7676
o.ExpectWithOffset(1, err).NotTo(o.HaveOccurred())
7777
result, err := CheckPageContains(oc, dcName, "", expected)
7878
o.ExpectWithOffset(1, err).NotTo(o.HaveOccurred())

test/extended/image_ecosystem/s2i_php.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = g.Describe("[image_ecosystem][php][Slow] hot deploy for openshift php im
6060
o.Expect(err).NotTo(o.HaveOccurred())
6161

6262
assertPageCountIs := func(i int) {
63-
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
63+
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 4*time.Minute)
6464
o.ExpectWithOffset(1, err).NotTo(o.HaveOccurred())
6565

6666
result, err := CheckPageContains(oc, "cakephp-mysql-example", "", pageCountFn(i))

test/extended/image_ecosystem/s2i_python.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var _ = g.Describe("[image_ecosystem][python][Slow] hot deploy for openshift pyt
7575
o.Expect(err).NotTo(o.HaveOccurred())
7676

7777
assertPageCountIs := func(i int, dcLabel labels.Selector) {
78-
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
78+
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 4*time.Minute)
7979
o.ExpectWithOffset(1, err).NotTo(o.HaveOccurred())
8080

8181
result, err := CheckPageContains(oc, dcName, "", pageCountFn(i))

test/extended/image_ecosystem/s2i_ruby.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var _ = g.Describe("[image_ecosystem][ruby][Slow] hot deploy for openshift ruby
6868
o.Expect(err).NotTo(o.HaveOccurred())
6969

7070
assertPageContent := func(content string, dcLabel labels.Selector) {
71-
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunningFn, 1, 4*time.Minute)
71+
_, err := exutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 4*time.Minute)
7272
o.ExpectWithOffset(1, err).NotTo(o.HaveOccurred())
7373

7474
result, err := CheckPageContains(oc, dcName, "", content)

test/extended/jobs/jobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var _ = g.Describe("[job][Conformance] openshift can execute jobs", func() {
2929
o.Expect(err).NotTo(o.HaveOccurred())
3030

3131
g.By("waiting for a pod...")
32-
podNames, err := exeutil.WaitForPods(oc.KubeClient().CoreV1().Pods(oc.Namespace()), exeutil.ParseLabelsOrDie(labels), exeutil.CheckPodIsSucceededFn, 1, 3*time.Minute)
32+
podNames, err := exeutil.WaitForPods(oc.KubeClient().CoreV1().Pods(oc.Namespace()), exeutil.ParseLabelsOrDie(labels), exeutil.CheckPodIsSucceeded, 1, 3*time.Minute)
3333
o.Expect(err).NotTo(o.HaveOccurred())
3434
o.Expect(len(podNames)).Should(o.Equal(1))
3535

0 commit comments

Comments
 (0)