Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
machine424 committed Jun 27, 2024
1 parent 39676fd commit b4e355d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/e2e/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,18 @@ func TestPrometheusMetrics(t *testing.T) {
}
}

// TestPrometheusGOGC verifies that Prometheus containers use the appropriate gogc value. It also helps us stay informed
// about any changes to the default gogc value upstream. If that value changes, this test will fail, prompting us to
// TestPrometheusGOGC verifies that Prometheus containers in HA mode use the appropriate gogc value. It also helps us stay informed
// about any changes to that default gogc value upstream. If that value changes, this test will fail, prompting us to
// consider whether the new default value is still suitable.
// Refer to this link for some points that may need to be examined https://github.com/openshift/prometheus/pull/206#issuecomment-2182168575.
func TestPrometheusGOGC(t *testing.T) {
t.Parallel()
infra, err := f.OperatorClient.GetInfrastructure(ctx, "cluster")
require.NoError(t, err)
infraConfig := operator.NewInfrastructureConfig(infra)

gogc := 100
if infraConfig.HighlyAvailableInfrastructure() {
gogc = 75
}
gogc := 75
f.ThanosQuerierClient.WaitForQueryReturn(
t, 5*time.Minute, `min(go_gc_gogc_percent{namespace="openshift-monitoring", service="prometheus-k8s", container="kube-rbac-proxy"})`, // kube-rbac-proxy exposes prometheus container's metrics.
func(v float64) error {
if v != float64(gogc) {
return fmt.Errorf("expected gogc for prometheus to be %f", v)
return fmt.Errorf("expected gogc for prometheus in HA mode to be %d but got %f", gogc, v)
}

return nil
Expand Down

0 comments on commit b4e355d

Please sign in to comment.