From 3dd4062b741d48d9b27d20056246d507b65bbe4b Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:59:48 -0700 Subject: [PATCH] Fix data race in 'discard connections' pool test. [v1] --- Makefile | 2 +- x/mongo/driver/topology/pool_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8922d4d82c..3fccb6f090 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ test-race: .PHONY: test-short test-short: - go test $(BUILD_TAGS) -timeout 60s -short ./... + go test $(BUILD_TAGS) -timeout 60s -short -race ./... ### Local FaaS targets. ### .PHONY: build-faas-awslambda diff --git a/x/mongo/driver/topology/pool_test.go b/x/mongo/driver/topology/pool_test.go index 0f8a5a0570..4de2efecef 100644 --- a/x/mongo/driver/topology/pool_test.go +++ b/x/mongo/driver/topology/pool_test.go @@ -868,7 +868,7 @@ func TestPool(t *testing.T) { go func() { select { case nc := <-ncs: - _, err = nc.Write([]byte{5, 0, 0, 0, 0}) + _, err := nc.Write([]byte{5, 0, 0, 0, 0}) require.NoError(t, err, "Write error") case <-time.After(100 * time.Millisecond): }