Skip to content

Commit cece170

Browse files
strogiyotecAlmas Abdrazak
andauthored
JAVA-4320 fix server selection flaky test (#1847)
* JAVA-4320 fix server selection flaky test * set server selection threshold to 3seconds * serverSelection flaky test, update comments * server selection , update threshold to 30_000 MS --------- Co-authored-by: Almas Abdrazak <abdrazak.almas@mongodb.com>
1 parent 7408493 commit cece170

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

driver-sync/src/test/functional/com/mongodb/client/AbstractServerSelectionProseTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import com.mongodb.ServerAddress;
2121
import com.mongodb.event.CommandStartedEvent;
2222
import com.mongodb.internal.connection.TestCommandListener;
23+
24+
import java.util.concurrent.TimeUnit;
25+
2326
import org.bson.BsonArray;
2427
import org.bson.BsonBoolean;
2528
import org.bson.BsonDocument;
@@ -77,6 +80,7 @@ void operationCountBasedSelectionWithinLatencyWindow() throws InterruptedExcepti
7780
MongoClientSettings clientSettings = getMongoClientSettingsBuilder()
7881
.applicationName(appName)
7982
.applyConnectionString(multiMongosConnectionString)
83+
.applyToClusterSettings(builder -> builder.localThreshold(30_000L, TimeUnit.MILLISECONDS))
8084
.applyToConnectionPoolSettings(builder -> builder
8185
.minSize(tasks))
8286
.addCommandListener(commandListener)

0 commit comments

Comments
 (0)