Skip to content

Commit 94e99a0

Browse files
authored
fix benchmark job (envoyproxy#6979)
Signed-off-by: zirain <zirain2009@gmail.com>
1 parent ef509f1 commit 94e99a0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

test/benchmark/config/nighthawk-client.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
- name: nighthawk-client
1212
image: envoyproxy/nighthawk-dev:latest
1313
imagePullPolicy: IfNotPresent
14-
args: ["nighthawk_client"] # Fill-up args at runtime
14+
command:
15+
- /usr/local/bin/nighthawk_client
1516
restartPolicy: Never
1617
backoffLimit: 3

test/benchmark/config/nighthawk-test-server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
- name: nighthawk-server
2020
image: envoyproxy/nighthawk-dev:latest
2121
imagePullPolicy: IfNotPresent
22-
args: ["nighthawk_test_server", "-c", "/etc/test-server-config/nighthawk-test-server-config.yaml"]
22+
args: ["-c", "/etc/test-server-config/nighthawk-test-server-config.yaml"]
2323
ports:
2424
- containerPort: 8080
2525
volumeMounts:

test/benchmark/suite/suite.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (b *BenchmarkTestSuite) Benchmark(t *testing.T, ctx context.Context, jobNam
191191
for i := 1; i <= host; i++ {
192192
requestHeaders = append(requestHeaders, "Host: "+fmt.Sprintf(hostnamePattern, i))
193193
}
194-
jobNN, err := b.createBenchmarkClientJob(ctx, jobName, gatewayHostPort, requestHeaders)
194+
jobNN, err := b.createBenchmarkClientJob(t, jobName, gatewayHostPort, requestHeaders)
195195
if err != nil {
196196
return nil, err
197197
}
@@ -251,7 +251,7 @@ func (b *BenchmarkTestSuite) Benchmark(t *testing.T, ctx context.Context, jobNam
251251
return report, nil
252252
}
253253

254-
func (b *BenchmarkTestSuite) createBenchmarkClientJob(ctx context.Context, name, gatewayHostPort string, requestHeaders []string) (*types.NamespacedName, error) {
254+
func (b *BenchmarkTestSuite) createBenchmarkClientJob(t *testing.T, name, gatewayHostPort string, requestHeaders []string) (*types.NamespacedName, error) {
255255
job := b.BenchmarkClientJob.DeepCopy()
256256
job.SetName(name)
257257
job.SetLabels(map[string]string{
@@ -262,7 +262,8 @@ func (b *BenchmarkTestSuite) createBenchmarkClientJob(ctx context.Context, name,
262262
container := &job.Spec.Template.Spec.Containers[0]
263263
container.Args = append(container.Args, runtimeArgs...)
264264

265-
if err := b.CreateResource(ctx, job); err != nil {
265+
t.Logf("Creating benchmark client job: %s with args: %v", name, job)
266+
if err := b.CreateResource(t.Context(), job); err != nil {
266267
return nil, err
267268
}
268269

0 commit comments

Comments
 (0)