Skip to content

Commit 413e60c

Browse files
committed
CDRIVER-696 fix test when server isn't on 27017
1 parent 827d2d8 commit 413e60c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/test-mongoc-server-selection-errors.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,18 @@ test_server_selection_error_dns_multi_fail (void)
5959
static void
6060
test_server_selection_error_dns_multi_success (void *context)
6161
{
62-
server_selection_error_dns (
63-
"mongodb://non-existing-localhost:27017,localhost:27017,other-non-existing-localhost:27017/",
64-
"",
65-
true
66-
);
62+
char *uri_str;
63+
64+
uri_str = bson_strdup_printf (
65+
"mongodb://non-existing-localhost:27017,"
66+
"%s:%d,"
67+
"other-non-existing-localhost:27017/",
68+
test_framework_get_host (),
69+
test_framework_get_port ());
70+
71+
server_selection_error_dns (uri_str, "", true);
72+
73+
bson_free (uri_str);
6774
}
6875

6976
void

0 commit comments

Comments
 (0)