Skip to content

Commit

Permalink
GODRIVER-2464 Add delay in RTT monitor test so Windows can measure a …
Browse files Browse the repository at this point in the history
…non-zero latency. (#1022)
  • Loading branch information
matthewdale authored and prestonvasquez committed Jul 14, 2022
1 parent 3b7e3eb commit 9bbe96c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/mongo/driver/topology/rtt_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ func TestRTTMonitor(t *testing.T) {
return
}

// Delay for 10ms so that systems with limited timing granularity (e.g. some
// older versions of Windows) can measure a non-zero latency.
time.Sleep(10 * time.Millisecond)

if _, err := conn.Write(makeHelloReply()); err != nil {
// The connection read/write loop is cancelled by closing the connection,
// so may be an expected error here. Log the error to make debugging
Expand Down

0 comments on commit 9bbe96c

Please sign in to comment.