@@ -85,52 +85,60 @@ func TestCSOTProse(t *testing.T) {
85
85
"insert" , "expected a second insert event, got %v" , started [1 ].CommandName )
86
86
})
87
87
mt .Run ("8. server selection" , func (mt * mtest.T ) {
88
- cliOpts := options .Client ().ApplyURI ("mongodb://invalid/?serverSelectionTimeoutMS=10 " )
88
+ cliOpts := options .Client ().ApplyURI ("mongodb://invalid/?serverSelectionTimeoutMS=100 " )
89
89
mtOpts := mtest .NewOptions ().ClientOptions (cliOpts ).CreateCollection (false )
90
90
mt .RunOpts ("serverSelectionTimeoutMS honored if timeoutMS is not set" , mtOpts , func (mt * mtest.T ) {
91
+ mt .Parallel ()
92
+
91
93
callback := func (ctx context.Context ) {
92
94
err := mt .Client .Ping (ctx , nil )
93
95
assert .NotNil (mt , err , "expected Ping error, got nil" )
94
96
}
95
97
96
- // Assert that Ping fails within 15ms due to server selection timeout.
97
- assert .Soon (mt , callback , 15 * time .Millisecond )
98
+ // Assert that Ping fails within 150ms due to server selection timeout.
99
+ assert .Soon (mt , callback , 150 * time .Millisecond )
98
100
})
99
101
100
- cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=10 &serverSelectionTimeoutMS=20 " )
102
+ cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=100 &serverSelectionTimeoutMS=200 " )
101
103
mtOpts = mtest .NewOptions ().ClientOptions (cliOpts ).CreateCollection (false )
102
104
mt .RunOpts ("timeoutMS honored for server selection if it's lower than serverSelectionTimeoutMS" , mtOpts , func (mt * mtest.T ) {
105
+ mt .Parallel ()
106
+
103
107
callback := func (ctx context.Context ) {
104
108
err := mt .Client .Ping (ctx , nil )
105
109
assert .NotNil (mt , err , "expected Ping error, got nil" )
106
110
}
107
111
108
- // Assert that Ping fails within 15ms due to timeout.
109
- assert .Soon (mt , callback , 15 * time .Millisecond )
112
+ // Assert that Ping fails within 150ms due to timeout.
113
+ assert .Soon (mt , callback , 150 * time .Millisecond )
110
114
})
111
115
112
- cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=20 &serverSelectionTimeoutMS=10 " )
116
+ cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=200 &serverSelectionTimeoutMS=100 " )
113
117
mtOpts = mtest .NewOptions ().ClientOptions (cliOpts ).CreateCollection (false )
114
118
mt .RunOpts ("serverSelectionTimeoutMS honored for server selection if it's lower than timeoutMS" , mtOpts , func (mt * mtest.T ) {
119
+ mt .Parallel ()
120
+
115
121
callback := func (ctx context.Context ) {
116
122
err := mt .Client .Ping (ctx , nil )
117
123
assert .NotNil (mt , err , "expected Ping error, got nil" )
118
124
}
119
125
120
- // Assert that Ping fails within 15ms due to server selection timeout.
121
- assert .Soon (mt , callback , 15 * time .Millisecond )
126
+ // Assert that Ping fails within 150ms due to server selection timeout.
127
+ assert .Soon (mt , callback , 150 * time .Millisecond )
122
128
})
123
129
124
- cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=0&serverSelectionTimeoutMS=10 " )
130
+ cliOpts = options .Client ().ApplyURI ("mongodb://invalid/?timeoutMS=0&serverSelectionTimeoutMS=100 " )
125
131
mtOpts = mtest .NewOptions ().ClientOptions (cliOpts ).CreateCollection (false )
126
132
mt .RunOpts ("serverSelectionTimeoutMS honored for server selection if timeoutMS=0" , mtOpts , func (mt * mtest.T ) {
133
+ mt .Parallel ()
134
+
127
135
callback := func (ctx context.Context ) {
128
136
err := mt .Client .Ping (ctx , nil )
129
137
assert .NotNil (mt , err , "expected Ping error, got nil" )
130
138
}
131
139
132
- // Assert that Ping fails within 15ms due to server selection timeout.
133
- assert .Soon (mt , callback , 15 * time .Millisecond )
140
+ // Assert that Ping fails within 150ms due to server selection timeout.
141
+ assert .Soon (mt , callback , 150 * time .Millisecond )
134
142
})
135
143
})
136
144
}
0 commit comments