Skip to content

Commit

Permalink
pool: fix flaky TestConnectionHandlerOpenUpdateClose
Browse files Browse the repository at this point in the history
It's better to wait for a discovered event instead of deactivated
to handle finish of a role update.
  • Loading branch information
oleg-jukovec committed Oct 31, 2022
1 parent 24a1c4e commit 789ee16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connection_pool/connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func TestConnectionHandlerOpenUpdateClose(t *testing.T) {
for i := 0; i < 100; i++ {
// Wait for read_only update, it should report about close connection
// with old role.
if h.deactivated >= 1 {
if h.discovered >= 3 {
break
}
time.Sleep(poolOpts.CheckTimeout)
Expand Down

0 comments on commit 789ee16

Please sign in to comment.