@@ -70,6 +70,9 @@ const fastPodFailureBackoff = 100 * time.Millisecond
70
70
// verify there is no change.
71
71
const sleepDurationForControllerLatency = 100 * time .Millisecond
72
72
73
+ const restConfigQPS = 10_000
74
+ const restConfigBurst = 10_000
75
+
73
76
type metricLabelsWithValue struct {
74
77
Labels []string
75
78
Value int
@@ -172,8 +175,8 @@ func TestJobPodFailurePolicyWithFailedPodDeletedDuringControllerRestart(t *testi
172
175
cancel ()
173
176
}()
174
177
resetMetrics ()
175
- restConfig .QPS = 200
176
- restConfig .Burst = 200
178
+ restConfig .QPS = restConfigQPS
179
+ restConfig .Burst = restConfigBurst
177
180
178
181
// create a job with a failed pod matching the exit code rule and a couple of successful pods
179
182
jobObj , err := createJobWithDefaults (ctx , cs , ns .Name , & job )
@@ -3304,6 +3307,8 @@ func TestElasticIndexedJob(t *testing.T) {
3304
3307
// also faster to track, as they need less API calls.
3305
3308
func BenchmarkLargeIndexedJob (b * testing.B ) {
3306
3309
closeFn , restConfig , clientSet , ns := setup (b , "indexed" )
3310
+ // During the benchmark, we restrict the client QPS and Burst to ensure that
3311
+ // the job-controller performance is fast enough in the limited QPS and Burst situations.
3307
3312
restConfig .QPS = 100
3308
3313
restConfig .Burst = 100
3309
3314
defer closeFn ()
@@ -3387,6 +3392,8 @@ func BenchmarkLargeFailureHandling(b *testing.B) {
3387
3392
b .Cleanup (setDurationDuringTest (& jobcontroller .DefaultJobPodFailureBackOff , fastPodFailureBackoff ))
3388
3393
b .Cleanup (setDurationDuringTest (& jobcontroller .MaxJobPodFailureBackOff , fastPodFailureBackoff ))
3389
3394
closeFn , restConfig , clientSet , ns := setup (b , "indexed" )
3395
+ // During the benchmark, we restrict the client QPS and Burst to ensure that
3396
+ // the job-controller performance is fast enough in the limited QPS and Burst situations.
3390
3397
restConfig .QPS = 100
3391
3398
restConfig .Burst = 100
3392
3399
defer closeFn ()
@@ -3513,8 +3520,8 @@ func TestOrphanPodsFinalizersClearedWithGC(t *testing.T) {
3513
3520
jc , ctx , cancel := createJobControllerWithSharedInformers (t , restConfig , informerSet )
3514
3521
resetMetrics ()
3515
3522
defer cancel ()
3516
- restConfig .QPS = 200
3517
- restConfig .Burst = 200
3523
+ restConfig .QPS = restConfigQPS
3524
+ restConfig .Burst = restConfigBurst
3518
3525
runGC := util .CreateGCController (ctx , t , * restConfig , informerSet )
3519
3526
informerSet .Start (ctx .Done ())
3520
3527
go jc .Run (ctx , 1 )
@@ -4352,8 +4359,8 @@ func setup(t testing.TB, nsBaseName string) (framework.TearDownFunc, *restclient
4352
4359
server := kubeapiservertesting .StartTestServerOrDie (t , nil , framework .DefaultTestServerFlags (), framework .SharedEtcd ())
4353
4360
4354
4361
config := restclient .CopyConfig (server .ClientConfig )
4355
- config .QPS = 200
4356
- config .Burst = 200
4362
+ config .QPS = restConfigQPS
4363
+ config .Burst = restConfigBurst
4357
4364
config .Timeout = 0
4358
4365
clientSet , err := clientset .NewForConfig (config )
4359
4366
if err != nil {
0 commit comments