Skip to content

GODRIVER-1489 Skip RTT assertion on Windows #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mongo/integration/sdam_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package integration

import (
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -67,7 +68,13 @@ func TestSDAMProse(t *testing.T) {
for _, serverDesc := range testTopology.Description().Servers {
assert.NotEqual(mt, description.Unknown, serverDesc.Kind, "server %v is Unknown", serverDesc)
assert.True(mt, serverDesc.AverageRTTSet, "AverageRTTSet for server description %v is false", serverDesc)
assert.True(mt, serverDesc.AverageRTT > 0, "server description %v has 0 RTT", serverDesc)

if runtime.GOOS != "windows" {
// Windows has a lower time resolution than other platforms, which causes the reported RTT to be
// 0 if it's below some threshold. The assertion above already confirms that the RTT is set to
// a value, so we can skip this assertion on Windows.
assert.True(mt, serverDesc.AverageRTT > 0, "server description %v has 0 RTT", serverDesc)
}
}

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