Skip to content

Commit 029f5ad

Browse files
author
Divjot Arora
authored
GODRIVER-1489 Skip RTT assertion on Windows (#442)
1 parent 2ff9f87 commit 029f5ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mongo/integration/sdam_prose_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package integration
88

99
import (
10+
"runtime"
1011
"testing"
1112
"time"
1213

@@ -67,7 +68,13 @@ func TestSDAMProse(t *testing.T) {
6768
for _, serverDesc := range testTopology.Description().Servers {
6869
assert.NotEqual(mt, description.Unknown, serverDesc.Kind, "server %v is Unknown", serverDesc)
6970
assert.True(mt, serverDesc.AverageRTTSet, "AverageRTTSet for server description %v is false", serverDesc)
70-
assert.True(mt, serverDesc.AverageRTT > 0, "server description %v has 0 RTT", serverDesc)
71+
72+
if runtime.GOOS != "windows" {
73+
// Windows has a lower time resolution than other platforms, which causes the reported RTT to be
74+
// 0 if it's below some threshold. The assertion above already confirms that the RTT is set to
75+
// a value, so we can skip this assertion on Windows.
76+
assert.True(mt, serverDesc.AverageRTT > 0, "server description %v has 0 RTT", serverDesc)
77+
}
7178
}
7279

7380
// Force isMaster requests to block for 500ms and wait until a server's average RTT goes over 250ms.

0 commit comments

Comments
 (0)