diff --git a/test/performance/framework/client_pod/create.go b/test/performance/framework/client_pod/create.go index 637e6d64137..8aa3a3f8c85 100644 --- a/test/performance/framework/client_pod/create.go +++ b/test/performance/framework/client_pod/create.go @@ -70,7 +70,7 @@ func CreatePod(ctx context.Context, kClient kubernetes.Interface, probes []strin Name: containerName, Image: "busybox", // read up rest /dev/null && echo \"up\" || echo \"down\"); current_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\"); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\") Status changed from $last_status to $status after ${time_diff} nanoseconds\"; echo \"$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\") 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\n", server, port)}, + Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; 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\" %s > /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\n", server, port)}, ImagePullPolicy: corev1.PullIfNotPresent, Env: []corev1.EnvVar{ { diff --git a/test/performance/framework/client_pod/update.go b/test/performance/framework/client_pod/update.go index c2b9c677625..af0b1f54e81 100644 --- a/test/performance/framework/client_pod/update.go +++ b/test/performance/framework/client_pod/update.go @@ -53,7 +53,7 @@ func Update(ctx context.Context, kClient kubernetes.Interface, ns, clientDaemonS containers = append(containers, corev1.Container{ Name: containerName, Image: "busybox", - Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", server, port)}, + Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; 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 status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\"); 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} seconds\"; echo \"$current_time Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", server, port)}, ImagePullPolicy: corev1.PullIfNotPresent, Env: []corev1.EnvVar{ { diff --git a/test/performance/framework/client_pod/update_test.go b/test/performance/framework/client_pod/update_test.go index efe6f6c538b..231bb1f385f 100644 --- a/test/performance/framework/client_pod/update_test.go +++ b/test/performance/framework/client_pod/update_test.go @@ -6,5 +6,5 @@ import ( ) func TestCmd(t *testing.T) { - fmt.Printf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", "127.0.0.1", "80") + fmt.Printf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); if [ \"$status\" != \"$last_status\" ]; then echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", "127.0.0.1", "80") } diff --git a/test/performance/framework/service/scale_up.go b/test/performance/framework/service/scale_up.go index f00e3c434fd..6bf598f5de2 100644 --- a/test/performance/framework/service/scale_up.go +++ b/test/performance/framework/service/scale_up.go @@ -161,7 +161,6 @@ func ScaleUp(ctx context.Context, provider providers.ProviderInterface, controlP if err != nil { klog.ErrorS(err, "Create client test Pod failed") } - time.Sleep(time.Second) } newSvc, err = cs.CoreV1().Services(ns).Create(ctx, svc, metav1.CreateOptions{}) if err != nil { diff --git a/test/performance/framework/workload_pod/update.go b/test/performance/framework/workload_pod/update.go index b0070efd1fd..1ad878916c6 100644 --- a/test/performance/framework/workload_pod/update.go +++ b/test/performance/framework/workload_pod/update.go @@ -53,7 +53,7 @@ func CreateClientPod(ctx context.Context, kClient kubernetes.Interface, namespac Name: containerName, Image: "busybox", // read up rest /dev/null && echo \"up\" || echo \"down\"); current_time=$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\"); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\") Status changed from $last_status to $status after ${time_diff} nanoseconds\"; echo \"$(adjtimex | awk '/(time.tv_sec|time.tv_usec):/ { printf(\"%%06d\", $2) }' && printf \"\\n\") 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\n", server, port)}, + Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; 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\" %s > /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\n", server, port)}, ImagePullPolicy: corev1.PullIfNotPresent, Env: []corev1.EnvVar{ { @@ -96,14 +96,12 @@ func CreateClientPod(ctx context.Context, kClient kubernetes.Interface, namespac if expectContainerNum == len(pod.Spec.Containers) && pod.Status.Phase == corev1.PodRunning { return true, nil } - return false, nil }) if err != nil { return nil, err } - klog.InfoS("Create Client Pod successfully!") return newPod, nil }