Skip to content

Commit

Permalink
benchmark: submit keepalive requests concurrently with report.Run()
Browse files Browse the repository at this point in the history
Otherwise report won't consume the results and the benchmark hangs.
  • Loading branch information
Anthony Romano committed Oct 7, 2016
1 parent 71f8f3c commit c1d115b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/benchmark/cmd/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c1d115b

Please sign in to comment.