[GODRIVER-522] Some integration tests don't respect MONGODB_URI Created: 14/Aug/18  Updated: 24/Jul/20  Resolved: 24/Jul/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: David Golden Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It looks like there are integration tests that fail because they don't respect MONGDOB_URI. Example: with a server running on 27017 without auth, the tests fails to connect, even though the MONGODB_URI server supports auth.

$ AUTH=auth MONGODB_URI="mongodb://root:toor@metis.local:64506/?authMechanism=SCRAM-SHA-256&authSource=admin" go test ./core/integration
--- FAIL: TestTopologyServer (0.03s)
 --- FAIL: TestTopologyServer/Disconnect (0.01s)
 --- FAIL: TestTopologyServer/Disconnect/all_open_sockets_should_be_closed_after_disconnect (0.01s)
 server_test.go:187: Unepexted error: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.
 --- FAIL: TestTopologyServer/Shouldn't_be_able_to_get_more_than_max_connections (0.01s)
 server_test.go:56: Unepexted error: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.
--- FAIL: TestCommand (0.01s)
 command_test.go:44: Unepexted error: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.
FAIL
FAIL github.com/mongodb/mongo-go-driver/core/integration 1.947s

When run with no server on 27017, the following errors occur:

--- FAIL: TestCompression (0.05s)
        compressor_test.go:93: Unexpected error: element not found
--- FAIL: TestConnection (0.00s)
    --- FAIL: TestConnection/Initialize (0.00s)
        connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/ReadWrite (0.00s)
        connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/Expired (0.00s)
        --- FAIL: TestConnection/Expired/Idle_Timeout (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
        --- FAIL: TestConnection/Expired/Lifetime_Timeout (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/WriteContext (0.00s)
        --- FAIL: TestConnection/WriteContext/Cancel (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
        --- FAIL: TestConnection/WriteContext/Timeout (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/Write_After_Connection_Dead (0.00s)
        connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/ReadContext (0.00s)
        --- FAIL: TestConnection/ReadContext/Cancel (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
        --- FAIL: TestConnection/ReadContext/Timeout (0.00s)
                connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestConnection/Read_After_Connection_Dead (0.00s)
        connection_test.go:189: failed dialing mongodb server - ensure that one is running at 127.0.0.1:27017: dial tcp 127.0.0.1:27017: connect: connection refused
--- FAIL: TestPool (0.00s)
    --- FAIL: TestPool/Reuses_Connections (0.00s)
        pool_test.go:63: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestPool/Expired_Connections_Aren't_Returned (0.00s)
        pool_test.go:84: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestPool/Connection_Close_Does_Not_Error_After_Pool_Is_Closed (0.00s)
        pool_test.go:146: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestPool/Drain_Expires_Existing_Checked_Out_Connections (0.00s)
        pool_test.go:176: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
--- FAIL: TestTopologyServer (0.00s)
    --- FAIL: TestTopologyServer/Disconnect (0.00s)
        --- FAIL: TestTopologyServer/Disconnect/all_open_sockets_should_be_closed_after_disconnect (0.00s)
                server_test.go:187: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
    --- FAIL: TestTopologyServer/Shouldn't_be_able_to_get_more_than_max_connections (0.00s)
        server_test.go:56: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
--- FAIL: TestCommand (0.00s)
        command_test.go:44: Unepexted error: dial tcp 127.0.0.1:27017: connect: connection refused
FAIL
FAIL    github.com/mongodb/mongo-go-driver/core/integration     1.571s



 Comments   
Comment by David Golden [ 27/Aug/18 ]

I'm not currently debugging this. IIRC, some tests aren't respecting MONGODB_URI. Evergreen starts a server on 27017, so those tests still pass.

Comment by Jeffrey Yemin [ 20/Aug/18 ]

Also, tests are passing on Evergreen when auth is enabled.

Comment by Kristofer Brandow (Inactive) [ 20/Aug/18 ]

david.golden Are you still debugging this? Can we move this into Investigating?

Generated at Thu Feb 08 08:34:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.