Skip to content

Commit b598f9e

Browse files
committed
Shorten connect timeout in server monitor test
The test was taking 10 seconds to timeout, which seems extreme
1 parent 0cd416e commit b598f9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

driver-core/src/test/functional/com/mongodb/internal/connection/ServerMonitorSpecification.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import com.mongodb.connection.SocketStreamFactory
3131
import org.bson.types.ObjectId
3232

3333
import java.util.concurrent.CountDownLatch
34+
import java.util.concurrent.TimeUnit
3435

3536
import static com.mongodb.ClusterFixture.getCredentialWithCache
3637
import static com.mongodb.ClusterFixture.getPrimary
@@ -195,7 +196,9 @@ class ServerMonitorSpecification extends OperationFunctionalSpecification {
195196
latch.countDown()
196197
}
197198
},
198-
new InternalStreamConnectionFactory(new SocketStreamFactory(SocketSettings.builder().build(),
199+
new InternalStreamConnectionFactory(new SocketStreamFactory(SocketSettings.builder()
200+
.connectTimeout(500, TimeUnit.MILLISECONDS)
201+
.build(),
199202
getSslSettings()), getCredentialWithCache(), null, null, [], null),
200203
new TestConnectionPool())
201204
serverMonitor.start()

0 commit comments

Comments
 (0)