From c1e5d6d6dfc42ee845a691e7b42da68a7173771e Mon Sep 17 00:00:00 2001 From: Hisar Balik Date: Fri, 9 Aug 2024 16:16:05 +0200 Subject: [PATCH] test: Flaky self-monitor metric outage tests (#1334) --- test/integration/istio/metrics_self_monitor_outage_test.go | 2 +- test/testkit/mocks/telemetrygen/telemetrygen.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/integration/istio/metrics_self_monitor_outage_test.go b/test/integration/istio/metrics_self_monitor_outage_test.go index a0f769c10..6fd820594 100644 --- a/test/integration/istio/metrics_self_monitor_outage_test.go +++ b/test/integration/istio/metrics_self_monitor_outage_test.go @@ -41,7 +41,7 @@ var _ = Describe(suite.ID(), Label(suite.LabelSelfMonitoringMetricsOutage), Orde objs = append(objs, &metricPipeline, - telemetrygen.NewDeployment(mockNs, telemetrygen.SignalTypeMetrics, telemetrygen.WithRate(500_000), telemetrygen.WithWorkers(5)).WithReplicas(2).K8sObject(), + telemetrygen.NewDeployment(mockNs, telemetrygen.SignalTypeMetrics, telemetrygen.WithRate(10_000_000), telemetrygen.WithWorkers(50), telemetrygen.WithInterval("30s")).WithReplicas(2).K8sObject(), ) return objs diff --git a/test/testkit/mocks/telemetrygen/telemetrygen.go b/test/testkit/mocks/telemetrygen/telemetrygen.go index 664969fe7..ff3531fe1 100644 --- a/test/testkit/mocks/telemetrygen/telemetrygen.go +++ b/test/testkit/mocks/telemetrygen/telemetrygen.go @@ -91,6 +91,13 @@ func WithSpanSize(spanSize int) Option { } } +// WithInterval Reporting interval +func WithInterval(duration string) Option { + return func(spec *corev1.PodSpec) { + spec.Containers[0].Args = append(spec.Containers[0].Args, "--interval") + spec.Containers[0].Args = append(spec.Containers[0].Args, fmt.Sprintf("%v", duration)) + } +} func NewPod(namespace string, signalType SignalType, opts ...Option) *kitk8s.Pod { return kitk8s.NewPod(DefaultName, namespace).WithPodSpec(PodSpec(signalType, opts...)).WithLabel("app.kubernetes.io/name", DefaultName) }