Skip to content

Commit 9682c62

Browse files
authored
Merge pull request kubernetes#126905 from zhifei92/optimize-assert-for-e2e
Optimizing the context information for assertions on boolean types.
2 parents 2ce13eb + 7015f75 commit 9682c62

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/e2e/common/node/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ while true; do sleep 1; done
129129

130130
ginkgo.By(fmt.Sprintf("Container '%s': should be possible to delete", testContainer.Name))
131131
gomega.Expect(terminateContainer.Delete(ctx)).To(gomega.Succeed())
132-
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalse())
132+
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalseBecause("container '%s': should have been terminated by now.", testContainer.Name))
133133
}
134134
})
135135
})

test/e2e/storage/csimock/csi_storage_capacity.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,17 @@ var _ = utils.SIGDescribe("CSI Mock volume storage capacity", func() {
259259
// test.
260260
framework.Logf("PVC watch delivered incomplete data, cannot check annotation")
261261
case test.lateBinding:
262-
gomega.Expect(nodeAnnotationSet).To(gomega.BeTrue(), "selected-node should have been set")
262+
gomega.Expect(nodeAnnotationSet).To(gomega.BeTrueBecause("selected-node should have been set"))
263263
// Whether it gets reset depends on whether we have topology enabled. Without
264264
// it, rescheduling is unnecessary.
265265
if test.topology {
266-
gomega.Expect(nodeAnnotationReset).To(gomega.BeTrue(), "selected-node should have been set")
266+
gomega.Expect(nodeAnnotationReset).To(gomega.BeTrueBecause("selected-node should have been set"))
267267
} else {
268-
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalse(), "selected-node should not have been reset")
268+
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalseBecause("selected-node should not have been reset"))
269269
}
270270
default:
271-
gomega.Expect(nodeAnnotationSet).To(gomega.BeFalse(), "selected-node should not have been set")
272-
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalse(), "selected-node should not have been reset")
271+
gomega.Expect(nodeAnnotationSet).To(gomega.BeFalseBecause("selected-node should not have been set"))
272+
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalseBecause("selected-node should not have been reset"))
273273
}
274274
}
275275
})

0 commit comments

Comments
 (0)