From 6cd0720389880e95163ac3fdd62f61c8e9c08a89 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Tue, 27 Feb 2024 23:11:25 +0100 Subject: [PATCH] Fix busy wait loop in benchmark stream (#1703) --- internal/benchrunner/runners/stream/runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/benchrunner/runners/stream/runner.go b/internal/benchrunner/runners/stream/runner.go index 490a68e77..563665ab7 100644 --- a/internal/benchrunner/runners/stream/runner.go +++ b/internal/benchrunner/runners/stream/runner.go @@ -206,12 +206,14 @@ func (r *runner) wipeDataStreamsOnSetup() error { func (r *runner) run() (err error) { r.streamData() + ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() for { select { case err = <-r.errChanGenerators: close(r.done) return err - default: + case <-ticker.C: if signal.SIGINT() { close(r.done) return nil