From 6cbdef850ce83a8a2d507ec0d2052f5adbc72ed5 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 23 Aug 2024 14:27:26 +0200 Subject: [PATCH] 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. --- test/integration/framework/perf_utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/framework/perf_utils.go b/test/integration/framework/perf_utils.go index bb1d2704b82..566308355fc 100644 --- a/test/integration/framework/perf_utils.go +++ b/test/integration/framework/perf_utils.go @@ -18,6 +18,7 @@ package framework import ( "context" + "fmt" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -109,20 +110,19 @@ func (p *IntegrationTestNodePreparer) PrepareNodes(ctx context.Context, nextNode } } if err != nil { - klog.Fatalf("Error creating node: %v", err) + return fmt.Errorf("creating node: %w", err) } } nodes, err := waitListAllNodes(p.client) if err != nil { - klog.Fatalf("Error listing nodes: %v", err) + return fmt.Errorf("listing nodes: %w", err) } index := nextNodeIndex for _, v := range p.countToStrategy { for i := 0; i < v.Count; i, index = i+1, index+1 { if err := testutils.DoPrepareNode(ctx, p.client, &nodes.Items[index], v.Strategy); err != nil { - klog.Errorf("Aborting node preparation: %v", err) - return err + return fmt.Errorf("aborting node preparation: %w", err) } } }