Skip to content

Commit 32077a1

Browse files
authored
Merge pull request kubernetes#127135 from tenzen-y/increase-job-integraion-qps-and-burst
JobIntegrationTest: Increase the restConfig QPS and Burst parameters
2 parents 900cb40 + 61c9d67 commit 32077a1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

test/integration/job/job_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ const fastPodFailureBackoff = 100 * time.Millisecond
7070
// verify there is no change.
7171
const sleepDurationForControllerLatency = 100 * time.Millisecond
7272

73+
const restConfigQPS = 10_000
74+
const restConfigBurst = 10_000
75+
7376
type metricLabelsWithValue struct {
7477
Labels []string
7578
Value int
@@ -172,8 +175,8 @@ func TestJobPodFailurePolicyWithFailedPodDeletedDuringControllerRestart(t *testi
172175
cancel()
173176
}()
174177
resetMetrics()
175-
restConfig.QPS = 200
176-
restConfig.Burst = 200
178+
restConfig.QPS = restConfigQPS
179+
restConfig.Burst = restConfigBurst
177180

178181
// create a job with a failed pod matching the exit code rule and a couple of successful pods
179182
jobObj, err := createJobWithDefaults(ctx, cs, ns.Name, &job)
@@ -3304,6 +3307,8 @@ func TestElasticIndexedJob(t *testing.T) {
33043307
// also faster to track, as they need less API calls.
33053308
func BenchmarkLargeIndexedJob(b *testing.B) {
33063309
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.
33073312
restConfig.QPS = 100
33083313
restConfig.Burst = 100
33093314
defer closeFn()
@@ -3387,6 +3392,8 @@ func BenchmarkLargeFailureHandling(b *testing.B) {
33873392
b.Cleanup(setDurationDuringTest(&jobcontroller.DefaultJobPodFailureBackOff, fastPodFailureBackoff))
33883393
b.Cleanup(setDurationDuringTest(&jobcontroller.MaxJobPodFailureBackOff, fastPodFailureBackoff))
33893394
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.
33903397
restConfig.QPS = 100
33913398
restConfig.Burst = 100
33923399
defer closeFn()
@@ -3513,8 +3520,8 @@ func TestOrphanPodsFinalizersClearedWithGC(t *testing.T) {
35133520
jc, ctx, cancel := createJobControllerWithSharedInformers(t, restConfig, informerSet)
35143521
resetMetrics()
35153522
defer cancel()
3516-
restConfig.QPS = 200
3517-
restConfig.Burst = 200
3523+
restConfig.QPS = restConfigQPS
3524+
restConfig.Burst = restConfigBurst
35183525
runGC := util.CreateGCController(ctx, t, *restConfig, informerSet)
35193526
informerSet.Start(ctx.Done())
35203527
go jc.Run(ctx, 1)
@@ -4352,8 +4359,8 @@ func setup(t testing.TB, nsBaseName string) (framework.TearDownFunc, *restclient
43524359
server := kubeapiservertesting.StartTestServerOrDie(t, nil, framework.DefaultTestServerFlags(), framework.SharedEtcd())
43534360

43544361
config := restclient.CopyConfig(server.ClientConfig)
4355-
config.QPS = 200
4356-
config.Burst = 200
4362+
config.QPS = restConfigQPS
4363+
config.Burst = restConfigBurst
43574364
config.Timeout = 0
43584365
clientSet, err := clientset.NewForConfig(config)
43594366
if err != nil {

0 commit comments

Comments
 (0)