Skip to content

Commit

Permalink
use ClusterFixture.sleep() as per code review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanQingyangXu committed Oct 21, 2024
1 parent 1e918ad commit 2cb640e
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.mongodb.internal.connection;

import com.mongodb.ClusterFixture;
import com.mongodb.MongoException;
import com.mongodb.ServerAddress;
import com.mongodb.connection.ClusterConnectionMode;
Expand Down Expand Up @@ -129,12 +130,8 @@ private void doTest(final String srvHost, final String resolvedHost, final boole
cluster = new DnsMultiServerCluster(clusterId, settingsBuilder.build(),
serverFactory,
dnsSrvRecordMonitorFactory);
try {
Thread.sleep(100); // racy
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
// ignore
}

ClusterFixture.sleep(100);

final MongoException mongoException = cluster.getSrvResolutionException();
if (throwException) {
Expand Down

0 comments on commit 2cb640e

Please sign in to comment.