Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/libmongoc/tests/test-mongoc-exhaust.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ test_exhaust_cursor(bool pooled)
pool = test_framework_new_default_client_pool();
stream_tracker_track_pool(st, pool);
client = mongoc_client_pool_pop(pool);

// Wait for all background monitoring connections to be established.
mongoc_uri_t *uri = test_framework_get_uri();
// Server 4.4 added support for streaming monitoring and has 2 monitoring connections.
int monitor_count = test_framework_get_server_version() >= test_framework_str_to_version("4.4") ? 2 : 1;
const mongoc_host_list_t *hosts = mongoc_uri_get_hosts(uri);
while (hosts) {
stream_tracker_assert_eventual_active_count(st, hosts->host_and_port, monitor_count);
hosts = hosts->next;
}
mongoc_uri_destroy(uri);
} else {
client = test_framework_new_default_client();
stream_tracker_track_client(st, client);
Expand Down