Skip to content

Commit 6cbdef8

Browse files
committed
scheduler_perf: normal error handling during node creation
Calling klog.Fatalf is not a good way to report problems. It kills the entire test run, without given other code a chance to react.
1 parent 5447d28 commit 6cbdef8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/integration/framework/perf_utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package framework
1818

1919
import (
2020
"context"
21+
"fmt"
2122

2223
v1 "k8s.io/api/core/v1"
2324
"k8s.io/apimachinery/pkg/api/resource"
@@ -109,20 +110,19 @@ func (p *IntegrationTestNodePreparer) PrepareNodes(ctx context.Context, nextNode
109110
}
110111
}
111112
if err != nil {
112-
klog.Fatalf("Error creating node: %v", err)
113+
return fmt.Errorf("creating node: %w", err)
113114
}
114115
}
115116

116117
nodes, err := waitListAllNodes(p.client)
117118
if err != nil {
118-
klog.Fatalf("Error listing nodes: %v", err)
119+
return fmt.Errorf("listing nodes: %w", err)
119120
}
120121
index := nextNodeIndex
121122
for _, v := range p.countToStrategy {
122123
for i := 0; i < v.Count; i, index = i+1, index+1 {
123124
if err := testutils.DoPrepareNode(ctx, p.client, &nodes.Items[index], v.Strategy); err != nil {
124-
klog.Errorf("Aborting node preparation: %v", err)
125-
return err
125+
return fmt.Errorf("aborting node preparation: %w", err)
126126
}
127127
}
128128
}

0 commit comments

Comments
 (0)