Skip to content

Commit 0618fdf

Browse files
benjirewisBenjamin Rewis
authored andcommitted
GODRIVER-2483 Make RTT90 client integration test more reliable. (#1025)
1 parent c4993a5 commit 0618fdf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mongo/integration/client_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ func TestClient(t *testing.T) {
673673
SetHeartbeatInterval(reducedHeartbeatInterval).
674674
SetTimeout(0))
675675

676-
// Assert that RTT90s are eventually >300ms.
676+
// Assert that RTT90s are eventually >275ms.
677677
topo := getTopologyFromClient(mt.Client)
678678
assert.Soon(mt, func(ctx context.Context) {
679679
for {
@@ -686,12 +686,12 @@ func TestClient(t *testing.T) {
686686

687687
time.Sleep(100 * time.Millisecond)
688688

689-
// Wait for all of the server's RTT90s to be >300ms.
689+
// Wait for all of the server's RTT90s to be >275ms.
690690
done := true
691691
for _, desc := range topo.Description().Servers {
692692
server, err := topo.FindServer(desc)
693693
assert.Nil(mt, err, "FindServer error: %v", err)
694-
if server.RTT90() <= 300*time.Millisecond {
694+
if server.RTT90() <= 275*time.Millisecond {
695695
done = false
696696
}
697697
}
@@ -701,10 +701,10 @@ func TestClient(t *testing.T) {
701701
}
702702
}, 10*time.Second)
703703

704-
// Once we've waited for the RTT90 for the servers to be >300ms, run 10 Ping operations
705-
// with a timeout of 300ms and expect that they return timeout errors.
704+
// Once we've waited for the RTT90 for the servers to be >275ms, run 10 Ping operations
705+
// with a timeout of 275ms and expect that they return timeout errors.
706706
for i := 0; i < 10; i++ {
707-
ctx, cancel = context.WithTimeout(context.Background(), 300*time.Millisecond)
707+
ctx, cancel = context.WithTimeout(context.Background(), 275*time.Millisecond)
708708
err := mt.Client.Ping(ctx, nil)
709709
cancel()
710710
assert.NotNil(mt, err, "expected Ping to return an error")

0 commit comments

Comments
 (0)