Skip to content

Commit f1f16a1

Browse files
author
iwysiu
authored
GODRIVER-1589 fix data race in test (#404)
1 parent a50f838 commit f1f16a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x/mongo/driver/topology/resource_pool_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ func TestResourcePool(t *testing.T) {
184184
assert.Equal(t, int32(3), closeCalled, "expected close to be called 3 times, got %v", closeCalled)
185185
// rp.maintainTimer should be reset after Maintain runs. Stop() returns true if the
186186
// timer was set, ensuring that it was correctly reset.
187+
rp.Lock()
187188
assert.True(t, rp.maintainTimer.Stop(), "expected timer to be reset")
189+
rp.Unlock()
188190
})
189191
})
190192
}

0 commit comments

Comments
 (0)