diff --git a/test/performance/assets/service/client_pod.yaml b/test/performance/assets/service/client_pod.yaml index 514ed723d3e..72d0cd5b734 100644 --- a/test/performance/assets/service/client_pod.yaml +++ b/test/performance/assets/service/client_pod.yaml @@ -8,7 +8,7 @@ spec: - /bin/sh - -c - | - server=10.96.0.12; output_file="ping_log.txt"; if [ ! -e "$output_file" ]; then touch "$output_file"; fi; last_status="unknown"; last_change_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf("%06d", $2) }' && printf "\n"); while true; do current_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf("%06d", $2) }' && printf "\n"); status=$(nc -vz -w 1 "$server" 80 > /dev/null && echo "up" || echo "down"); time_diff=$((current_time - last_change_time)); if [ "$status" != "$last_status" ]; then echo "$current_time Status changed from $last_status to $status after ${time_diff} nanoseconds"; echo "$current_time Status changed from $last_status to $status after ${time_diff} nanoseconds" >> "$output_file"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done + server=""; output_file="ping_log.txt"; if [ ! -e "$output_file" ]; then touch "$output_file"; fi; last_status="unknown"; last_change_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf("%06d", $2) }' && printf "\n"); while true; do current_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf("%06d", $2) }' && printf "\n"); status=$(nc -vz -w 1 "$server" 80 > /dev/null && echo "up" || echo "down"); time_diff=$((current_time - last_change_time)); if [ "$status" != "$last_status" ]; then echo "$current_time Status changed from $last_status to $status after ${time_diff} nanoseconds"; echo "$current_time Status changed from $last_status to $status after ${time_diff} nanoseconds" >> "$output_file"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done image: busybox imagePullPolicy: IfNotPresent name: antrea-scale-test-pod-probe diff --git a/test/performance/config/config.go b/test/performance/config/config.go index 1032163a638..7c4a498a0ee 100644 --- a/test/performance/config/config.go +++ b/test/performance/config/config.go @@ -27,16 +27,15 @@ const ( ) type ScaleConfiguration struct { - TearDown bool `yaml:"teardown"` - IPv6 bool `yaml:"ipv6"` - RealNode bool `yaml:"real_node"` - RepeatTimes int `yaml:"repeat_times"` - PodsNumPerNs int `yaml:"pods_num_per_ns"` - SvcNumPerNs int `yaml:"svc_num_per_ns"` - NpNumPerNs int `yaml:"np_num_per_ns"` - RecordPrometheus bool `yaml:"record_prometheus"` - SkipDeployWorkload bool `yaml:"skip_deploy_workload"` - NamespaceNum int `yaml:"namespace_num"` + TearDown bool `yaml:"teardown"` // TearDown specifies whether to tear down the test Pods after testing. + IPv6 bool `yaml:"ipv6"` // IPv6 specifies whether to enable IPv6. + RealNode bool `yaml:"real_node"` // RealNode specifies whether to use simulator Antrea agents in testing. + RepeatTimes int `yaml:"repeat_times"` // RepeatTimes specifies the number of times to repeat the test. + PodsNumPerNs int `yaml:"pods_num_per_ns"` // PodsNumPerNs specifies the number of Pods per Namespace. + SvcNumPerNs int `yaml:"svc_num_per_ns"` // SvcNumPerNs specifies the number of Services per Namespace. + NpNumPerNs int `yaml:"np_num_per_ns"` // NpNumPerNs specifies the number of Networkpolicies per Namespace. + SkipDeployWorkload bool `yaml:"skip_deploy_workload"` // SkipDeployWorkload specifies whether to skip deploying workload test Pods during testing. + NamespaceNum int `yaml:"namespace_num"` // NamespaceNum specifies the number of Namespaces to create. } type Scale struct { diff --git a/test/performance/framework/setup.go b/test/performance/framework/setup.go index a170d4f4196..02b0d2e3f41 100644 --- a/test/performance/framework/setup.go +++ b/test/performance/framework/setup.go @@ -80,11 +80,10 @@ func createAndWaitTestPodClients(ctx context.Context, kClient kubernetes.Interfa if err != nil { return false, nil } - return ds.Status.DesiredNumberScheduled == ds.Status.NumberReady, nil - }); err != nil { - return fmt.Errorf("error when waiting scale test clients to be ready: %w", err) - } - if err := wait.PollUntilContextCancel(ctx, config.WaitInterval, true, func(ctx context.Context) (bool, error) { + if ds.Status.DesiredNumberScheduled != ds.Status.NumberReady { + return false, nil + } + podList, err := kClient.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{LabelSelector: clientpod.ScaleClientPodTemplateName}) if err != nil { return false, nil @@ -96,7 +95,7 @@ func createAndWaitTestPodClients(ctx context.Context, kClient kubernetes.Interfa } return true, nil }); err != nil { - return fmt.Errorf("error when waiting scale test clients to get IP: %w", err) + return fmt.Errorf("error when waiting scale test clients to be ready: %w", err) } return nil }