Skip to content

Commit 55b1e87

Browse files
committed
fix expected test result
1 parent 70ac6d0 commit 55b1e87

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

e2e/switchover_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ var _ = Context("switchover", Ordered, func() {
6060
})
6161

6262
It("should switch the primary if requested, even when a long global read lock is acquired", func() {
63+
cluster, err := getCluster("switchover", "test")
64+
Expect(err).NotTo(HaveOccurred())
65+
66+
beforePrimaryIndex := cluster.Status.CurrentPrimaryIndex
67+
6368
go func() {
6469
// Calling SLEEP within an UPDATE statement creates a situation where a global read lock is intentionally acquired.
6570
// The value specified for SLEEP must be less than half the value of `PreStopSeconds`.
@@ -74,7 +79,7 @@ var _ = Context("switchover", Ordered, func() {
7479
return 0
7580
}
7681
return cluster.Status.CurrentPrimaryIndex
77-
}).ShouldNot(Equal(0))
82+
}).ShouldNot(Equal(beforePrimaryIndex))
7883

7984
Eventually(func() error {
8085
cluster, err := getCluster("switchover", "test")

0 commit comments

Comments
 (0)