@@ -172,19 +172,16 @@ func runLeasePreferences(
172
172
// waitForLessPreferred=false). This duration is used to ensure the lease
173
173
// preference satisfaction is reasonably permanent.
174
174
const stableDuration = 30 * time .Second
175
+ // initialWaitDuration is how long the test will wait for initial lease
176
+ // preference conformance. This duration is approx. a replica scanner cycle.
177
+ const initialWaitDuration = 10 * time .Minute
175
178
176
179
numNodes := c .Spec ().NodeCount
177
180
allNodes := make ([]int , 0 , numNodes )
178
181
for i := 1 ; i <= numNodes ; i ++ {
179
182
allNodes = append (allNodes , i )
180
183
}
181
184
182
- // TODO(kvoli): temporary workaround for
183
- // https://github.com/cockroachdb/cockroach/issues/105274
184
- settings := install .MakeClusterSettings ()
185
- settings .ClusterSettings ["server.span_stats.span_batch_limit" ] = "4096"
186
- settings .ClusterSettings ["kv.enqueue_in_replicate_queue_on_span_config_update.enabled" ] = "true"
187
-
188
185
startNodes := func (nodes ... int ) {
189
186
for _ , node := range nodes {
190
187
// Don't start a backup schedule because this test is timing sensitive.
@@ -198,7 +195,7 @@ func runLeasePreferences(
198
195
// dc=N: n2N-1 n2N
199
196
fmt .Sprintf ("--locality=region=fake-region,zone=fake-zone,dc=%d" , (node - 1 )/ 2 + 1 ),
200
197
"--vmodule=replica_proposal=2,lease_queue=3,lease=3" )
201
- c .Start (ctx , t .L (), opts , settings , c .Node (node ))
198
+ c .Start (ctx , t .L (), opts , install . MakeClusterSettings () , c .Node (node ))
202
199
203
200
}
204
201
}
@@ -215,9 +212,13 @@ func runLeasePreferences(
215
212
conn := c .Conn (ctx , t .L (), numNodes )
216
213
defer conn .Close ()
217
214
218
- checkLeasePreferenceConformance := func (ctx context.Context ) {
215
+ checkLeasePreferenceConformance := func (ctx context.Context , initial bool ) {
216
+ duration := spec .postEventWaitDuration
217
+ if initial {
218
+ duration = initialWaitDuration
219
+ }
219
220
result , err := waitForLeasePreferences (
220
- ctx , t , c , spec .checkNodes , spec .waitForLessPreferred , stableDuration , spec . postEventWaitDuration )
221
+ ctx , t , c , spec .checkNodes , spec .waitForLessPreferred , stableDuration , duration )
221
222
require .NoError (t , err , result )
222
223
require .Truef (t , ! result .violating (), "violating lease preferences %s" , result )
223
224
if spec .waitForLessPreferred {
@@ -260,7 +261,7 @@ func runLeasePreferences(
260
261
leasePreference : spec .preferences ,
261
262
})
262
263
t .L ().Printf ("waiting for initial lease preference conformance" )
263
- checkLeasePreferenceConformance (ctx )
264
+ checkLeasePreferenceConformance (ctx , true /* initial */ )
264
265
265
266
// Run the spec event function. The event function will move leases to
266
267
// non-conforming localities.
@@ -273,7 +274,7 @@ func runLeasePreferences(
273
274
// Wait for the preference conformance with some leases in non-conforming
274
275
// localities.
275
276
t .L ().Printf ("waiting for post-event lease preference conformance" )
276
- checkLeasePreferenceConformance (ctx )
277
+ checkLeasePreferenceConformance (ctx , false /* initial */ )
277
278
}
278
279
279
280
type leasePreferencesResult struct {
0 commit comments