Skip to content

Commit

Permalink
fix race condition in test
Browse files Browse the repository at this point in the history
  • Loading branch information
stlava committed Apr 30, 2024
1 parent 0c52880 commit 3c23f45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rediscluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,13 +938,13 @@ func (s *Suite) TestFallbackTimeoutLatency() {

s.cl.Node[0].Pause()
// test read from replica
s.Equal([]byte("1"), sconn.Do(s.ctx, "GET", key))
s.Contains(DebugEvents(), "retry")

// wait replica becomes master
s.cl.WaitClusterOk()
time.Sleep(longcheckopts.CheckInterval)

s.Equal(redis.ByteResponse{Val: []byte("1")}, sconn.Do(s.ctx, "GET", key))
s.Contains(DebugEvents(), "retry")

s.Equal("OK", sconn.Do(s.ctx, "SET", key, "1"))

// return master
Expand Down

0 comments on commit 3c23f45

Please sign in to comment.