From 989b3e1c8f5e8e07bfcc479eaa1e9e6bfa1eb8cf Mon Sep 17 00:00:00 2001 From: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:16:11 -0400 Subject: [PATCH] GODRIVER-2851 Fix failing "TestCMAPProse" test. (#1316) --- x/mongo/driver/topology/cmap_prose_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/x/mongo/driver/topology/cmap_prose_test.go b/x/mongo/driver/topology/cmap_prose_test.go index 1187a31f7f..53c6e9ba36 100644 --- a/x/mongo/driver/topology/cmap_prose_test.go +++ b/x/mongo/driver/topology/cmap_prose_test.go @@ -106,9 +106,6 @@ func TestCMAPProse(t *testing.T) { }) t.Run("checkOut", func(t *testing.T) { t.Run("connection error publishes events", func(t *testing.T) { - // TODO(GODRIVER-2851): Fix and unskip this test case. - t.Skip("Test fails frequently, skipping. See GODRIVER-2851") - // If checkOut() creates a connection that encounters an error while connecting, // the pool should publish connection created and closed events and checkOut should // return the error. @@ -131,8 +128,7 @@ func TestCMAPProse(t *testing.T) { _, err := pool.checkOut(context.Background()) assert.NotNil(t, err, "expected checkOut() error, got nil") - assert.Equal(t, 1, len(created), "expected 1 opened events, got %d", len(created)) - assert.Equal(t, 1, len(closed), "expected 1 closed events, got %d", len(closed)) + assertConnectionCounts(t, pool, 1, 1) }) t.Run("pool is empty", func(t *testing.T) { // If a checkOut() has to create a new connection and that connection encounters an