Skip to content

Commit 9bbe96c

Browse files
matthewdaleprestonvasquez
authored andcommitted
GODRIVER-2464 Add delay in RTT monitor test so Windows can measure a non-zero latency. (#1022)
1 parent 3b7e3eb commit 9bbe96c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

x/mongo/driver/topology/rtt_monitor_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ func TestRTTMonitor(t *testing.T) {
275275
return
276276
}
277277

278+
// Delay for 10ms so that systems with limited timing granularity (e.g. some
279+
// older versions of Windows) can measure a non-zero latency.
280+
time.Sleep(10 * time.Millisecond)
281+
278282
if _, err := conn.Write(makeHelloReply()); err != nil {
279283
// The connection read/write loop is cancelled by closing the connection,
280284
// so may be an expected error here. Log the error to make debugging

0 commit comments

Comments
 (0)