Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
None
-
None
-
None
-
Yes
-
Yes
-
No
-
C/S Core
Description
User impact:
As documented in the contribution guide it should be possible to run tests locally with make test.
Steps to reproduce:
make test-cluster make test
Actual result:
=== RUN TestConnect/Test_per-request_connection time="2022-09-12T13:22:32+01:00" level=error msg="Cannot connect to MongoDB: cannot connect to MongoDB: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: 172.25.0.12:27017, Type: Unknown }, { Addr: 172.25.0.3:27017, Type: Unknown }, { Addr: 172.25.0.10:27017, Type: Unknown }, ] }"
Expected result:
=== RUN TestConnect/Test_global_connection --- PASS: TestConnect (0.25s) --- PASS: TestConnect/Connect_without_SSL (0.07s) --- PASS: TestConnect/Test_per-request_connection (0.10s) --- PASS: TestConnect/Test_global_connection (0.08s)
Workaround:
Tests can be skipped, or with more effort could be run from a container within the same docker network.
Details:
Suggested fix is to enable direct connection for these tests such that the driver will connect only to the host provided.