Skip to content

Commit 288e1af

Browse files
committed
Update e2e test cases for changes
1 parent 90753e5 commit 288e1af

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

e2e/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ foundationdb-pr-tests: GINKGO_LABEL_FILTER=--ginkgo.label-filter="foundationdb-p
156156
# Run the actual foundationdb-pr tests.
157157
foundationdb-pr-tests: run
158158

159-
# Only run tests that are labeled with the "foundationdb-nightly" or "foundationdb-pr" label, this is used for the cluster tests in the
159+
# Only run tests that are labeled with the "foundationdb-nightly" or "foundationdb-pr" label, this is used for the cluster tests in the
160160
# foundationdb repo.
161161
foundationdb-nightly-tests: GINKGO_LABEL_FILTER=--ginkgo.label-filter="foundationdb-pr || foundationdb-nightly"
162162

e2e/test_operator_migrations/operator_migration_test.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ var _ = Describe("Operator Migrations", Label("e2e", "pr"), func() {
188188
})
189189

190190
It("should change the public IP source and create/delete services", func() {
191-
Eventually(func() bool {
191+
Eventually(func(g Gomega) {
192192
pods := fdbCluster.GetPods()
193193
svcList := fdbCluster.GetServices()
194194

@@ -204,33 +204,30 @@ var _ = Describe("Operator Migrations", Label("e2e", "pr"), func() {
204204
continue
205205
}
206206

207-
if _, ok := svcMap[pod.Name]; !ok {
208-
return false
209-
}
210-
207+
g.Expect(svcMap).To(HaveKey(pod.Name))
211208
delete(svcMap, pod.Name)
212209
}
213210

214211
// We only expect one service here at the end since we run the cluster with a headless service.
215212
if fdbCluster.HasHeadlessService() {
216-
return len(svcMap) == 1
213+
g.Expect(svcMap).To(HaveLen(1))
214+
return
217215
}
218-
return len(svcMap) == 0
219-
}).Should(BeTrue())
216+
217+
g.Expect(svcMap).To(BeEmpty())
218+
}).Should(Succeed())
220219
})
221220

222221
AfterEach(func() {
223222
log.Printf("set public IP source to %s", fdbv1beta2.PublicIPSourcePod)
224223
Expect(
225224
fdbCluster.SetPublicIPSource(fdbv1beta2.PublicIPSourcePod),
226225
).ShouldNot(HaveOccurred())
227-
svcList := fdbCluster.GetServices()
228-
229226
var expectedSvcCnt int
230227
if fdbCluster.HasHeadlessService() {
231228
expectedSvcCnt = 1
232229
}
233-
Expect(svcList.Items).To(HaveLen(expectedSvcCnt))
230+
Expect(fdbCluster.GetServices().Items).To(HaveLen(expectedSvcCnt))
234231
})
235232
})
236233

e2e/test_operator_upgrades_variations/operator_upgrades_variations_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures
8686
startTime := time.Now()
8787
loggingTime := time.Now()
8888
preUpgradeFunction(fdbCluster)
89+
// Block the restart of the fdbserver processes. If we don't block the restart, it will be hard to observe the condition
90+
// changes.
91+
fdbCluster.SetKillProcesses(false, false)
8992
Expect(fdbCluster.UpgradeCluster(config.targetVersion, false)).NotTo(HaveOccurred())
9093

9194
if !fixtures.VersionsAreProtocolCompatible(config.beforeVersion, config.targetVersion) {
@@ -104,6 +107,7 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures
104107
}
105108

106109
for _, processGroup := range fdbCluster.GetCluster().Status.ProcessGroups {
110+
// Ensure that at least one process group has the expected conditions.
107111
if processGroup.MatchesConditions(expectedConditions) {
108112
return true
109113
}
@@ -113,6 +117,9 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures
113117
}).WithTimeout(10 * time.Minute).WithPolling(5 * time.Second).Should(BeTrue())
114118
}
115119

120+
// Allow the restart of the fdbserver processes again, now the upgrade should be proceeding
121+
fdbCluster.SetKillProcesses(true, false)
122+
116123
loggingTime = time.Now()
117124
transactionSystemProcessGroups := make(map[fdbv1beta2.ProcessGroupID]fdbv1beta2.None)
118125
// Wait until the cluster is upgraded and fully reconciled.

0 commit comments

Comments
 (0)