diff --git a/tests/scalers/solace/solace_test.go b/tests/scalers/solace/solace_test.go index 81d5b478016..0b6292068a5 100644 --- a/tests/scalers/solace/solace_test.go +++ b/tests/scalers/solace/solace_test.go @@ -180,11 +180,11 @@ func TestStanScaler(t *testing.T) { } func installSolace(t *testing.T) { - _, err := ExecuteCommand("helm repo add solacecharts https://solaceproducts.github.io/pubsubplus-kubernetes-quickstart/helm-charts") + _, err := ExecuteCommand("helm repo add solacecharts https://solaceproducts.github.io/pubsubplus-kubernetes-helm-quickstart/helm-charts") assert.NoErrorf(t, err, "cannot execute command - %s", err) _, err = ExecuteCommand("helm repo update") assert.NoErrorf(t, err, "cannot execute command - %s", err) - _, err = ExecuteCommand(fmt.Sprintf(`helm upgrade --install --set solace.usernameAdminPassword=KedaLabAdminPwd1 --set storage.persistent=false --namespace %s --wait kedalab solacecharts/pubsubplus-dev`, + _, err = ExecuteCommand(fmt.Sprintf(`helm upgrade --install --set solace.usernameAdminPassword=KedaLabAdminPwd1 --set storage.persistent=false --namespace %s --wait --timeout 900s kedalab solacecharts/pubsubplus-dev`, testNamespace)) assert.NoErrorf(t, err, "cannot execute command - %s", err) // Create the pubsub broker diff --git a/tests/sequential/prometheus_metrics/prometheus_metrics_test.go b/tests/sequential/prometheus_metrics/prometheus_metrics_test.go index 0d5e9ec88be..346d9f2079d 100644 --- a/tests/sequential/prometheus_metrics/prometheus_metrics_test.go +++ b/tests/sequential/prometheus_metrics/prometheus_metrics_test.go @@ -31,6 +31,7 @@ var ( monitoredDeploymentName = fmt.Sprintf("%s-monitored", testName) scaledObjectName = fmt.Sprintf("%s-so", testName) wrongScaledObjectName = fmt.Sprintf("%s-wrong", testName) + wrongScalerName = fmt.Sprintf("%s-wrong-scaler", testName) cronScaledJobName = fmt.Sprintf("%s-cron-sj", testName) clientName = fmt.Sprintf("%s-client", testName) kedaOperatorPrometheusURL = "http://keda-operator.keda.svc.cluster.local:8080/metrics" @@ -44,6 +45,7 @@ type templateData struct { DeploymentName string ScaledObjectName string WrongScaledObjectName string + WrongScalerName string CronScaledJobName string MonitoredDeploymentName string ClientName string @@ -133,6 +135,7 @@ spec: cooldownPeriod: 10 triggers: - type: prometheus + name: {{.WrongScalerName}} metadata: serverAddress: http://keda-prometheus.keda.svc.cluster.local:8080 metricName: keda_scaler_errors_total @@ -320,6 +323,7 @@ func getTemplateData() (templateData, []Template) { DeploymentName: deploymentName, ScaledObjectName: scaledObjectName, WrongScaledObjectName: wrongScaledObjectName, + WrongScalerName: wrongScalerName, MonitoredDeploymentName: monitoredDeploymentName, ClientName: clientName, CronScaledJobName: cronScaledJobName, @@ -407,8 +411,8 @@ func testScalerErrors(t *testing.T, data templateData) { if val, ok := family["keda_scaler_errors"]; ok { errCounterVal1 := getErrorMetricsValue(val) - // wait for 4 seconds to correctly fetch metrics. - time.Sleep(4 * time.Second) + // wait for 10 seconds to correctly fetch metrics. + time.Sleep(10 * time.Second) family = fetchAndParsePrometheusMetrics(t, fmt.Sprintf("curl --insecure %s", kedaOperatorPrometheusURL)) if val, ok := family["keda_scaler_errors"]; ok { @@ -477,7 +481,7 @@ func getErrorMetricsValue(val *promModel.MetricFamily) float64 { for _, metric := range metrics { labels := metric.GetLabel() for _, label := range labels { - if *label.Name == "scaler" && *label.Value == "prometheusScaler" { + if *label.Name == "scaler" && *label.Value == wrongScalerName { return *metric.Counter.Value } }