Skip to content

Commit 1a7d830

Browse files
committed
remove benchmark tests
These sounded good when created, but in practice have not been used as much as expected. They frequently need to be adjusted when other changes to the code base adds processing time. For these reasons we are removing the benchmarks.
1 parent 0f1ee2c commit 1a7d830

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

pkg/cloud/cloud_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"strings"
66
"testing"
7-
"time"
87

98
. "github.com/onsi/gomega"
109

@@ -85,7 +84,6 @@ func getPlatforms() testPlatformsMap {
8584

8685
func TestGetResources(t *testing.T) {
8786
platformsMap := getPlatforms()
88-
getResourcesThresholdMs := 30 * time.Millisecond
8987

9088
t.Log("disabling klog logging")
9189
testingutils.TurnOffKlog()
@@ -322,25 +320,6 @@ func TestGetResources(t *testing.T) {
322320
assert.NotEqualValues(t, resources, newResources)
323321
}
324322
})
325-
326-
if !testing.Short() {
327-
t.Run(fmt.Sprintf("Benchmark: %s", tc.name), func(t *testing.T) {
328-
operatorConfig := tc.testPlatform.getOperatorConfig()
329-
operatorConfig.IsSingleReplica = tc.singleReplica
330-
benchResulst := testing.Benchmark(func(b *testing.B) {
331-
for i := 0; i < b.N; i++ {
332-
_, err := GetResources(operatorConfig)
333-
assert.NoError(t, err)
334-
}
335-
})
336-
assert.True(
337-
t,
338-
getResourcesThresholdMs.Nanoseconds() > benchResulst.NsPerOp(),
339-
"Resources rendering took too long, worth to check.",
340-
)
341-
fmt.Println(benchResulst)
342-
})
343-
}
344323
}
345324
}
346325

0 commit comments

Comments
 (0)