Paging Ticket - failing unit test, new ticket as requested

Problem: Unit test fails but ticket passes. Additional detail in link below.

My environment: Recently created Atlas cluster

Diagnosis: Once you pass the ticket you can view the official solution. Copying and pasting the official solution into the code results in the same unit test failure.

Conclusions
I can think of three possible causes. One is that the unit test is wrong. Another is that there is a ticket dependency issues such that a later ticket will result in this unit test eventually passing. Finally a previous ticket may be passing “incorrectly” and has a bug that effects this ticket.

See also:

Hi @David_18019,

Thanks for sharing your feedback. :slight_smile: I checked the solution and I am able to pass the unit test.

But you might be right as well, will you help us identify the issue? It would be great to see your code so that I can debug that. :slight_smile: If it is on github, you can share the link or you can also email me the zip.

Kanika

I created a github project with a zip file of my project that has this issue. How do I give you the link without sharing it with everyone? The email link you posted above is just to https://www.mongodb.com.

I also wonder now if the sample_mflix database changed at some point. I’ve been able to complete many more tickets with no other issues.

It did, few weeks back. The dataset was updated. Following that, we updated our unit test/ integration tests. If you did not download the handouts again in last few weeks, that might be the issue. :frowning:

Kanika

Hello @kanikasingla,
While running the below statement , the junit is failing. I wonder we need to pass spring.mongodb.uri as maven arguement.

mvn -Dtest=ConnectionTest test

Error Response:

2020-11-28 13:09:28.708 INFO 160934 — [ngodb.net:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address:27017=mflix-shard-00-01.hxbzv.mongodb.net, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 2, 10]}, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=62977575, setName=‘atlas-yj01bu-shard-0’, canonicalAddress:27017=mflix-shard-00-01.hxbzv.mongodb.net, hosts=[mflix-shard-00-01.hxbzv.mongodb.net:27017, mflix-shard-00-00.hxbzv.mongodb.net:27017, mflix-shard-00-02.hxbzv.mongodb.net:27017], passives=, arbiters=, primary=‘mflix-shard-00-01.hxbzv.mongodb.net:27017’, tagSet=TagSet{[Tag{name=‘nodeType’, value=‘ELECTABLE’}, Tag{name=‘provider’, value=‘AWS’}, Tag{name=‘workloadType’, value=‘OPERATIONAL’}, Tag{name=‘region’, value=‘AP_SOUTH_1’}]}, electionId=7fffffff0000000000000004, setVersion=1, lastWriteDate=Sat Nov 28 13:09:27 UTC 2020, lastUpdateTimeNanos=1934138908069828}
2020-11-28 13:09:28.708 INFO 160934 — [ngodb.net:27017] org.mongodb.driver.cluster : Setting max election id to 7fffffff0000000000000004 from replica set primary mflix-shard-00-01.hxbzv.mongodb.net:27017
2020-11-28 13:09:28.708 INFO 160934 — [ngodb.net:27017] org.mongodb.driver.cluster : Setting max set version to 1 from replica set primary mflix-shard-00-01.hxbzv.mongodb.net:27017
2020-11-28 13:09:28.708 INFO 160934 — [ngodb.net:27017] org.mongodb.driver.cluster : Discovered replica set primary mflix-shard-00-01.hxbzv.mongodb.net:27017
2020-11-28 13:09:29.304 INFO 160934 — [ main] org.mongodb.driver.connection : Opened connection [connectionId{localValue:12, serverValue:28237}] to mflix-shard-00-01.hxbzv.mongodb.net:27017
[ERROR] Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 7.598 s <<< FAILURE! - in mflix.api.daos.ConnectionTest
[ERROR] testMoviesCount(mflix.api.daos.ConnectionTest) Time elapsed: 0.821 s <<< FAILURE!
java.lang.AssertionError: Check your connection string expected:<23530> but was:<0>
at mflix.api.daos.ConnectionTest.testMoviesCount(ConnectionTest.java:44)

[ERROR] testConnectionFindsCollections(mflix.api.daos.ConnectionTest) Time elapsed: 1.107 s <<< FAILURE!
java.lang.AssertionError: Could not find all expected collections. Check your restore step expected:<0> but was:<4>
at mflix.api.daos.ConnectionTest.testConnectionFindsCollections(ConnectionTest.java:78)

[ERROR] testConnectionFindsDatabase(mflix.api.daos.ConnectionTest) Time elapsed: 1.138 s <<< FAILURE!
java.lang.AssertionError: We can connect to MongoDB, but couldn’t find expected database. Check the restore step
at mflix.api.daos.ConnectionTest.testConnectionFindsDatabase(ConnectionTest.java:58)

2020-11-28 13:09:29.550 INFO 160934 — [ Thread-2] o.s.w.c.s.GenericWebApplicationContext : Closing org.springframework.web.context.support.GenericWebApplicationContext@506ae4d4: startup date [Sat Nov 28 13:09:22 UTC 2020]; root of context hierarchy
2020-11-28 13:09:29.638 INFO 160934 — [ Thread-2] org.mongodb.driver.connection : Closed connection [connectionId{localValue:4, serverValue:28237}] to mflix-shard-00-01.hxbzv.mongodb.net:27017 because the pool has been closed.
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ConnectionTest.testConnectionFindsCollections:78 Could not find all expected collections. Check your restore step expected:<0> but was:<4>
[ERROR] ConnectionTest.testConnectionFindsDatabase:58 We can connect to MongoDB, but couldn’t find expected database. Check the restore step
[ERROR] ConnectionTest.testMoviesCount:44 Check your connection string expected:<23530> but was:<0>
[INFO]
[ERROR] Tests run: 3, Failures: 3, Errors: 0, Skipped: 0
[INFO]

Probably not.

I suspect that there is no data on your cluster. Can you see the collections in Compass?

1 Like

Hi @kanikasingla,
While executing the unit tests with the below command, Junit is failing.

mvn test -Dtest=ConnectionTest

Error Response:

2021-04-05 10:41:06.993  INFO 14300 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@162b3d47, org.springframework.security.web.context.SecurityContextPersistenceFilter@629adce, org.springframework.security.web.header.HeaderWriterFilter@100c567f, org.springframework.security.web.csrf.CsrfFilter@4bafe935, org.springframework.security.web.authentication.logout.LogoutFilter@bdd2027, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@36b310aa, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@1128620c, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1816e24a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@743c6ce4, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@108d55c4, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@783115d9, org.springframework.security.web.session.SessionManagementFilter@6d5037a9, org.springframework.security.web.access.ExceptionTranslationFilter@2b917fb0, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@34fe326d]
2021-04-05 10:41:07.278  INFO 14300 --- [           main] mflix.api.daos.ConnectionTest            : Started ConnectionTest in 10.047 seconds (JVM running for 11.712)
2021-04-05 10:41:07.631  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-01.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:41:07.637  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-00.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:41:07.642  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-02.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:41:07.660  INFO 14300 --- [           main] org.mongodb.driver.cluster               : No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@396639b from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, ServerDescription{address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, ServerDescription{address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]}. Waiting for 30000 ms before timing out
2021-04-05 10:41:37.808  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[mflix-shard-00-00.m2f7g.mongodb.net:27017, mflix-shard-00-01.m2f7g.mongodb.net:27017, mflix-shard-00-02.m2f7g.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='atlas-46mpki-shard-0'}
2021-04-05 10:41:37.808  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-00.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:41:37.809  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-01.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:41:37.810  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-02.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:41:37.836  INFO 14300 --- [           main] org.mongodb.driver.cluster               : No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@56380231 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
2021-04-05 10:41:38.911  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-02.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:41:38.947  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-00.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:41:39.054  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-01.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:42:09.683  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[mflix-shard-00-02.m2f7g.mongodb.net:27017, mflix-shard-00-00.m2f7g.mongodb.net:27017, mflix-shard-00-01.m2f7g.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='atlas-46mpki-shard-0'}
2021-04-05 10:42:09.684  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-02.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:42:09.686  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-00.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:42:09.688  INFO 14300 --- [           main] org.mongodb.driver.cluster               : Adding discovered server mflix-shard-00-01.m2f7g.mongodb.net:27017 to client view of cluster
2021-04-05 10:42:09.699  INFO 14300 --- [           main] org.mongodb.driver.cluster               : No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@242a209e from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
2021-04-05 10:42:10.744  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-00.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:42:11.262  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-01.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2021-04-05 10:42:11.268  INFO 14300 --- [ngodb.net:27017] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server mflix-shard-00-02.m2f7g.mongodb.net:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
        at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:570) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:441) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:295) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.sendAndReceive(CommandHelper.java:83) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.CommandHelper.executeCommand(CommandHelper.java:33) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:106) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) ~[mongodb-driver-core-3.9.1.jar:na]
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.9.1.jar:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 103.57 s <<< FAILURE! - in mflix.api.daos.ConnectionTest
[ERROR] testMoviesCount(mflix.api.daos.ConnectionTest)  Time elapsed: 30.245 s  <<< ERROR!
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@396639b. Client view of cluster state is {type=REPLICA_SET, servers=[{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
        at mflix.api.daos.ConnectionTest.testMoviesCount(ConnectionTest.java:44)

[ERROR] testConnectionFindsCollections(mflix.api.daos.ConnectionTest)  Time elapsed: 30.163 s  <<< ERROR!
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@56380231. Client view of cluster state is {type=REPLICA_SET, servers=[{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
        at mflix.api.daos.ConnectionTest.testConnectionFindsCollections(ConnectionTest.java:71)

[ERROR] testConnectionFindsDatabase(mflix.api.daos.ConnectionTest)  Time elapsed: 31.855 s  <<< ERROR!
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@242a209e. Client view of cluster state is {type=REPLICA_SET, servers=[{address=mflix-shard-00-02.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-00.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=mflix-shard-00-01.m2f7g.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
        at mflix.api.daos.ConnectionTest.testConnectionFindsDatabase(ConnectionTest.java:52)

2021-04-05 10:42:40.160  INFO 14300 --- [       Thread-3] o.s.w.c.s.GenericWebApplicationContext   : Closing org.springframework.web.context.support.GenericWebApplicationContext@909217e: startup date [Mon Apr 05 10:40:58 IST 2021]; root of context hierarchy
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   ConnectionTest.testConnectionFindsCollections:71 » MongoTimeout Timed out afte...
[ERROR]   ConnectionTest.testConnectionFindsDatabase:52 » MongoTimeout Timed out after 3...
[ERROR]   ConnectionTest.testMoviesCount:44 » MongoTimeout Timed out after 30000 ms whil...
[INFO]
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0
[INFO]