Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
  • Loading branch information
wenqiq committed Apr 11, 2024
1 parent de34149 commit f7dacb3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/performance/assets/service/client_pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 9 additions & 10 deletions test/performance/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 5 additions & 6 deletions test/performance/framework/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit f7dacb3

Please sign in to comment.