GODRIVER-2068 Use monitor.TestPoolMonitor to replace most connection pool monitors in tests. #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GODRIVER-2068
There are various test types that are used as an
*event.PoolMonitor
and all work slightly differently with different levels of isolation between tests. The existingtestPoolMonitor
in themongo/integration
package tests can satisfy the use cases of all pool monitors used in tests and is intended to be instantiated per-test to prevent interaction between tests. Move the existingtestPoolMonitor
into a new test utility packageinternal/testutil/monitor
and use it in most tests that require a connection pool monitor.Making the new test pool monitor available to all tests also allows us to improve the flaky
TestServerConnectionTimeout
test by replacing the test-specific pool monitor with amonitor.TestPoolMonitor
.Changes:
*event.PoolMonitor
and replace them with the newmonitor.TestPoolMonitor
type.internal/testutil
package.