From 1cb4e0beda6a3535e72924cc95693730d319b6f2 Mon Sep 17 00:00:00 2001 From: Oleg Jukovec Date: Mon, 31 Oct 2022 13:46:10 +0300 Subject: [PATCH] pool: fix flaky TestConnectionHandlerOpenUpdateClose It's better to wait for a discovered event instead of deactivated to handle finish of a role update. --- connection_pool/connection_pool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connection_pool/connection_pool_test.go b/connection_pool/connection_pool_test.go index 091d5216c..60c9b4f91 100644 --- a/connection_pool/connection_pool_test.go +++ b/connection_pool/connection_pool_test.go @@ -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)