From 5a87f8c5228f53337388f5fa95922c5d20f4fc30 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Sat, 25 Nov 2023 01:54:16 +0900 Subject: [PATCH] =?UTF-8?q?stdout,=20stderr=E3=82=82=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE200=E8=A1=8C=E3=81=A0=E3=81=91=E9=80=81?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bench/cmd/bench/supervise.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bench/cmd/bench/supervise.go b/bench/cmd/bench/supervise.go index cf9e64c0d..b7487ab22 100644 --- a/bench/cmd/bench/supervise.go +++ b/bench/cmd/bench/supervise.go @@ -182,8 +182,8 @@ func execBench(ctx context.Context, job *Job) (*Result, error) { if err != nil { return &Result{ ID: job.ID, - Stdout: stdout.String(), - Stderr: stderr.String(), + Stdout: joinN(strings.Split(stdout.String(), "\n"), messageLimit), + Stderr: joinN(strings.Split(stderr.String(), "\n"), messageLimit), Reason: err.Error(), IsPassed: false, Score: 0, @@ -200,8 +200,8 @@ func execBench(ctx context.Context, job *Job) (*Result, error) { if err != nil { return &Result{ ID: job.ID, - Stdout: stdout.String(), - Stderr: stderr.String(), + Stdout: joinN(strings.Split(stdout.String(), "\n"), messageLimit), + Stderr: joinN(strings.Split(stderr.String(), "\n"), messageLimit), Reason: err.Error(), IsPassed: false, Score: 0, @@ -215,8 +215,8 @@ func execBench(ctx context.Context, job *Job) (*Result, error) { if err := json.NewDecoder(bytes.NewBuffer(b)).Decode(&benchResult); err != nil { return &Result{ ID: job.ID, - Stdout: stdout.String(), - Stderr: stderr.String(), + Stdout: joinN(strings.Split(stdout.String(), "\n"), messageLimit), + Stderr: joinN(strings.Split(stderr.String(), "\n"), messageLimit), Reason: err.Error(), IsPassed: false, Score: 0, @@ -232,8 +232,8 @@ func execBench(ctx context.Context, job *Job) (*Result, error) { log.Println("success benchmark") return &Result{ ID: job.ID, - Stdout: stdout.String(), - Stderr: stderr.String(), + Stdout: joinN(strings.Split(stdout.String(), "\n"), messageLimit), + Stderr: joinN(strings.Split(stderr.String(), "\n"), messageLimit), Reason: joinN(msgs, messageLimit), IsPassed: benchResult.Pass, Score: benchResult.Score, @@ -246,8 +246,8 @@ func execBench(ctx context.Context, job *Job) (*Result, error) { log.Println("fail benchmark") return &Result{ ID: job.ID, - Stdout: stdout.String(), - Stderr: stderr.String(), + Stdout: joinN(strings.Split(stdout.String(), "\n"), messageLimit), + Stderr: joinN(strings.Split(stderr.String(), "\n"), messageLimit), Reason: "ベンチマーク失敗", IsPassed: false, Score: 0,