diff --git a/bench/cmd/bench/supervise.go b/bench/cmd/bench/supervise.go index 27a98e467..ce69d6452 100644 --- a/bench/cmd/bench/supervise.go +++ b/bench/cmd/bench/supervise.go @@ -395,11 +395,10 @@ var supervise = cli.Command{ NotifyWorkerErr(job, err, "", "", "ベンチマーカーの結果送信に失敗。すぐに調査してください。supervisorの処理は継続します") } - _ = finalcheckBucketName - // log.Println("upload finalcheck result") - // if err := UploadFinalcheckResult(finalcheckBucketName, job.ID, job.Team); err != nil { - // NotifyWorkerErr(job, err, "", "", "FinalCheckの結果送信に失敗。すぐに調査してください。supervisorの処理は継続します") - // } + log.Println("upload finalcheck result") + if err := UploadFinalcheckResult(finalcheckBucketName, job.ID, job.Team); err != nil { + NotifyWorkerErr(job, err, "", "", "FinalCheckの結果送信に失敗。すぐに調査してください。supervisorの処理は継続します") + } log.Println("cleanup old logs for next job") os.Remove(config.StaffLogPath) diff --git a/bench/scenario/core_finalcheck.go b/bench/scenario/core_finalcheck.go index 1cf236850..1cf6a0f9a 100644 --- a/bench/scenario/core_finalcheck.go +++ b/bench/scenario/core_finalcheck.go @@ -2,7 +2,9 @@ package scenario import ( "context" + "encoding/json" "os" + "time" "github.com/isucon/isucandar/agent" "github.com/isucon/isucon13/bench/internal/config" @@ -13,6 +15,17 @@ import ( func FinalcheckScenario(ctx context.Context, contestantLogger *zap.Logger, dnsResolver *resolver.DNSResolver) error { + // 3秒待つ +loop: + for { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(3 * time.Second): + break loop + } + } + client, err := isupipe.NewCustomResolverClient( contestantLogger, dnsResolver, @@ -21,11 +34,28 @@ func FinalcheckScenario(ctx context.Context, contestantLogger *zap.Logger, dnsRe if err != nil { return err } + // タグ指定なし検索 + searchedStream, err := client.SearchLivestreams(ctx, isupipe.WithLimitQueryParam(config.NumSearchLivestreams)) + if err != nil { + return err + } + lgr := zap.S() + ids := []int64{} + for _, stream := range searchedStream { + ids = append(ids, stream.ID) + } + b, err := json.Marshal(ids) + if err != nil { + return err + } + lgr.Info("Finalcheck SearchLivestreams IDs:", string(b)) - // FIXME: ライブコメント存在チェック - _ = client + b2, err := json.Marshal(searchedStream) + if err != nil { + return err + } - if err := os.WriteFile(config.FinalcheckPath, []byte("{}"), os.ModePerm); err != nil { + if err := os.WriteFile(config.FinalcheckPath, b2, os.ModePerm); err != nil { return err }