From c1d115b3223582f55b21631316a8d81c87d138bd Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Fri, 7 Oct 2016 15:55:42 -0700 Subject: [PATCH] benchmark: submit keepalive requests concurrently with report.Run() Otherwise report won't consume the results and the benchmark hangs. --- tools/benchmark/cmd/lease.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/benchmark/cmd/lease.go b/tools/benchmark/cmd/lease.go index 81dd30cb670..4c21f9f7beb 100644 --- a/tools/benchmark/cmd/lease.go +++ b/tools/benchmark/cmd/lease.go @@ -68,10 +68,14 @@ func leaseKeepaliveFunc(cmd *cobra.Command, args []string) { }(clients[i]) } - for i := 0; i < leaseKeepaliveTotal; i++ { - requests <- struct{}{} - } - close(requests) + wg.Add(1) + go func() { + defer wg.Done() + for i := 0; i < leaseKeepaliveTotal; i++ { + requests <- struct{}{} + } + close(requests) + }() rc := r.Run() wg.Wait()