From 07daa09cf6fdf98f683fe6fd2bd810de0d8647a6 Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Thu, 21 Mar 2024 19:29:37 +0800 Subject: [PATCH] Fix checking channel Signed-off-by: Wenqi Qiu --- test/performance/framework/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/performance/framework/service.go b/test/performance/framework/service.go index 15ab6f88600..5d0c3a32a9a 100644 --- a/test/performance/framework/service.go +++ b/test/performance/framework/service.go @@ -59,7 +59,7 @@ func ScaleService(ctx context.Context, ch chan time.Duration, data *ScaleData) ( defer func() { res.err = err for { - if len(ch) == res.scaleNum { + if len(ch) == cap(ch) { break } klog.InfoS("Waiting the check goroutine finish") @@ -205,7 +205,7 @@ func scaleUp(ctx context.Context, data *ScaleData, ch chan time.Duration) (svcs var err error var clientPod *corev1.Pod svc.Spec.ClusterIP = clusterIP.String() - klog.InfoS("go FetchTimestampFromLog", "cap(ch)", cap(ch)) + klog.InfoS("go FetchTimestampFromLog", "cap(ch)", cap(ch), "len(ch)", len(ch)) fromPod := &podList.Items[testPodIndex%len(podList.Items)] testPodIndex++ clientPod, err = workload_pod.CreateClientPod(ctx, cs, fromPod.Namespace, fromPod.Name, []string{fmt.Sprintf("%s:%d", clusterIP, 80)}, workload_pod.ScaleTestPodProbeContainerName)