Skip to content

Commit 3b7b50a

Browse files
committed
Create fresh etcd instance for each workload in scheduler_perf
1 parent 1747483 commit 3b7b50a

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

test/integration/framework/etcd.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ func getAvailablePort() (int, error) {
6464

6565
// startEtcd executes an etcd instance. The returned function will signal the
6666
// etcd process and wait for it to exit.
67-
func startEtcd(output io.Writer) (func(), error) {
68-
etcdURL := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
69-
conn, err := net.Dial("tcp", strings.TrimPrefix(etcdURL, "http://"))
70-
if err == nil {
71-
klog.Infof("etcd already running at %s", etcdURL)
72-
conn.Close()
73-
return func() {}, nil
67+
func startEtcd(output io.Writer, forceCreate bool) (func(), error) {
68+
if !forceCreate {
69+
etcdURL := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
70+
conn, err := net.Dial("tcp", strings.TrimPrefix(etcdURL, "http://"))
71+
if err == nil {
72+
klog.Infof("etcd already running at %s", etcdURL)
73+
_ = conn.Close()
74+
return func() {}, nil
75+
}
76+
klog.V(1).Infof("could not connect to etcd: %v", err)
7477
}
75-
klog.V(1).Infof("could not connect to etcd: %v", err)
7678

7779
currentURL, stop, err := RunCustomEtcd("integration_test_etcd_data", nil, output)
7880
if err != nil {
@@ -217,7 +219,7 @@ func EtcdMain(tests func() int) {
217219
goleak.IgnoreTopFunction("github.com/moby/spdystream.(*Connection).shutdown"),
218220
)
219221

220-
stop, err := startEtcd(nil)
222+
stop, err := startEtcd(nil, false)
221223
if err != nil {
222224
klog.Fatalf("cannot run integration tests: unable to start etcd: %v", err)
223225
}
@@ -247,8 +249,8 @@ func GetEtcdURL() string {
247249
//
248250
// Starting etcd multiple times per test run instead of once with EtcdMain
249251
// provides better separation between different tests.
250-
func StartEtcd(tb testing.TB, etcdOutput io.Writer) {
251-
stop, err := startEtcd(etcdOutput)
252+
func StartEtcd(tb testing.TB, etcdOutput io.Writer, forceCreate bool) {
253+
stop, err := startEtcd(etcdOutput, forceCreate)
252254
if err != nil {
253255
tb.Fatalf("unable to start etcd: %v", err)
254256
}

test/integration/scheduler_perf/config/performance-config.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
initPods: 500
3131
measurePods: 1000
3232
- name: 5000Nodes
33-
labels: [performance, fast]
33+
labels: [fast]
3434
params:
3535
initNodes: 5000
3636
initPods: 1000
@@ -65,7 +65,7 @@
6565
initPods: 100
6666
measurePods: 400
6767
- name: 5000Nodes
68-
labels: [performance, fast]
68+
labels: [fast]
6969
params:
7070
initNodes: 5000
7171
initPods: 1000
@@ -95,7 +95,7 @@
9595
initPods: 500
9696
measurePods: 1000
9797
- name: 5000Nodes
98-
labels: [performance, fast]
98+
labels: [fast]
9999
params:
100100
initNodes: 5000
101101
initPods: 5000
@@ -108,7 +108,6 @@
108108
measurePods: 10000
109109

110110
- name: SchedulingInTreePVs
111-
labels: [performance]
112111
workloadTemplate:
113112
- opcode: createNodes
114113
countParam: $initNodes
@@ -134,13 +133,13 @@
134133
initPods: 5000
135134
measurePods: 1000
136135
- name: 5000Nodes_2000Pods
136+
labels: [performance]
137137
params:
138138
initNodes: 5000
139139
initPods: 1000
140140
measurePods: 2000
141141

142142
- name: SchedulingMigratedInTreePVs
143-
labels: [performance]
144143
workloadTemplate:
145144
- opcode: createNodes
146145
countParam: $initNodes
@@ -175,13 +174,13 @@
175174
initPods: 5000
176175
measurePods: 1000
177176
- name: 5000Nodes_5000Pods
177+
labels: [performance]
178178
params:
179179
initNodes: 5000
180180
initPods: 5000
181181
measurePods: 5000
182182

183183
- name: SchedulingCSIPVs
184-
labels: [performance]
185184
workloadTemplate:
186185
- opcode: createNodes
187186
countParam: $initNodes
@@ -214,6 +213,7 @@
214213
initPods: 5000
215214
measurePods: 1000
216215
- name: 5000Nodes_5000Pods
216+
labels: [performance]
217217
params:
218218
initNodes: 5000
219219
initPods: 5000
@@ -246,7 +246,7 @@
246246
initPods: 500
247247
measurePods: 1000
248248
- name: 5000Nodes
249-
labels: [performance, fast]
249+
labels: [fast]
250250
params:
251251
initNodes: 5000
252252
initPods: 5000
@@ -259,7 +259,6 @@
259259
measurePods: 5000
260260

261261
- name: SchedulingPreferredPodAffinity
262-
labels: [performance]
263262
defaultPodTemplatePath: config/templates/pod-with-preferred-pod-affinity.yaml
264263
workloadTemplate:
265264
- opcode: createNodes
@@ -287,6 +286,7 @@
287286
initPods: 5000
288287
measurePods: 1000
289288
- name: 5000Nodes_5000Pods
289+
labels: [performance]
290290
params:
291291
initNodes: 5000
292292
initPods: 5000
@@ -315,7 +315,7 @@
315315
initPods: 500
316316
measurePods: 1000
317317
- name: 5000Nodes
318-
labels: [performance, fast]
318+
labels: [fast]
319319
params:
320320
initNodes: 5000
321321
initPods: 5000
@@ -376,7 +376,7 @@
376376
initPods: 500
377377
measurePods: 1000
378378
- name: 5000Nodes
379-
labels: [performance, fast]
379+
labels: [fast]
380380
params:
381381
initNodes: 5000
382382
initPods: 5000
@@ -411,7 +411,7 @@
411411
initPods: 1000
412412
measurePods: 1000
413413
- name: 5000Nodes
414-
labels: [performance, fast]
414+
labels: [fast]
415415
params:
416416
initNodes: 5000
417417
initPods: 5000
@@ -424,7 +424,6 @@
424424
measurePods: 5000
425425

426426
- name: PreferredTopologySpreading
427-
labels: [performance]
428427
workloadTemplate:
429428
- opcode: createNodes
430429
countParam: $initNodes
@@ -452,13 +451,13 @@
452451
initPods: 5000
453452
measurePods: 2000
454453
- name: 5000Nodes_5000Pods
454+
labels: [performance]
455455
params:
456456
initNodes: 5000
457457
initPods: 5000
458458
measurePods: 5000
459459

460460
- name: MixedSchedulingBasePod
461-
labels: [performance]
462461
defaultPodTemplatePath: config/templates/pod-default.yaml
463462
workloadTemplate:
464463
- opcode: createNodes
@@ -505,6 +504,7 @@
505504
initPods: 2000
506505
measurePods: 1000
507506
- name: 5000Nodes_5000Pods
507+
labels: [performance]
508508
params:
509509
initNodes: 5000
510510
initPods: 2000
@@ -588,7 +588,7 @@
588588
initPods: 200
589589
measurePods: 1000
590590
- name: 5000Nodes/200InitPods
591-
labels: [performance, fast]
591+
labels: [fast]
592592
params:
593593
initNodes: 5000
594594
initPods: 200
@@ -628,7 +628,7 @@
628628
initNodes: 1000
629629
measurePods: 1000
630630
- name: 5000Nodes
631-
labels: [performance, fast]
631+
labels: [fast]
632632
params:
633633
initNodes: 5000
634634
measurePods: 2000
@@ -639,7 +639,6 @@
639639
measurePods: 10000
640640

641641
- name: SchedulingRequiredPodAntiAffinityWithNSSelector
642-
labels: [performance]
643642
defaultPodTemplatePath: config/templates/pod-anti-affinity-ns-selector.yaml
644643
workloadTemplate:
645644
- opcode: createNodes
@@ -677,14 +676,14 @@
677676
initNamespaces: 100
678677
measurePods: 1000
679678
- name: 5000Nodes_2000Pods
679+
labels: [performance]
680680
params:
681681
initNodes: 6000
682682
initPodsPerNamespace: 40
683683
initNamespaces: 100
684684
measurePods: 2000
685685

686686
- name: SchedulingPreferredAntiAffinityWithNSSelector
687-
labels: [performance]
688687
defaultPodTemplatePath: config/templates/pod-preferred-anti-affinity-ns-selector.yaml
689688
workloadTemplate:
690689
- opcode: createNodes
@@ -722,14 +721,14 @@
722721
initNamespaces: 100
723722
measurePods: 1000
724723
- name: 5000Nodes_2000Pods
724+
labels: [performance]
725725
params:
726726
initNodes: 5000
727727
initPodsPerNamespace: 40
728728
initNamespaces: 100
729729
measurePods: 2000
730730

731731
- name: SchedulingRequiredPodAffinityWithNSSelector
732-
labels: [performance]
733732
defaultPodTemplatePath: config/templates/pod-affinity-ns-selector.yaml
734733
workloadTemplate:
735734
- opcode: createNodes
@@ -770,14 +769,14 @@
770769
initNamespaces: 100
771770
measurePods: 1000
772771
- name: 5000Nodes_2000Pods
772+
labels: [performance]
773773
params:
774774
initNodes: 5000
775775
initPodsPerNamespace: 50
776776
initNamespaces: 100
777777
measurePods: 2000
778778

779779
- name: SchedulingPreferredAffinityWithNSSelector
780-
labels: [performance]
781780
defaultPodTemplatePath: config/templates/pod-preferred-affinity-ns-selector.yaml
782781
workloadTemplate:
783782
- opcode: createNodes
@@ -815,6 +814,7 @@
815814
initNamespaces: 100
816815
measurePods: 1000
817816
- name: 5000Nodes_5000Pods
817+
labels: [performance]
818818
params:
819819
initNodes: 5000
820820
initPodsPerNamespace: 50

test/integration/scheduler_perf/scheduler_perf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@ func setupTestCase(t testing.TB, tc *testCase, output io.Writer, outOfTreePlugin
777777
framework.GoleakCheck(t)
778778

779779
// Now that we are ready to run, start
780-
// etcd.
781-
framework.StartEtcd(t, output)
780+
// a brand new etcd.
781+
framework.StartEtcd(t, output, true)
782782

783783
for feature, flag := range tc.FeatureGates {
784784
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, feature, flag)

0 commit comments

Comments
 (0)