From 8886e58ae95fda0e68762d0028e3ec7942133503 Mon Sep 17 00:00:00 2001 From: songlh Date: Fri, 17 Dec 2021 15:22:27 -0500 Subject: [PATCH] add comments to the fix --- pkg/util/async/bounded_frequency_runner_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/util/async/bounded_frequency_runner_test.go b/pkg/util/async/bounded_frequency_runner_test.go index 898ea016174..348169fb4e8 100644 --- a/pkg/util/async/bounded_frequency_runner_test.go +++ b/pkg/util/async/bounded_frequency_runner_test.go @@ -277,7 +277,9 @@ func Test_BoundedFrequencyRunnerNoBurst(t *testing.T) { // Clean up. stop <- struct{}{} - <- time.updated + //a message is sent to time.updated in func Stop() at the end of the child goroutine + //to terminate the child, a receive on time.updated is needed here + <- time.updated } func Test_BoundedFrequencyRunnerBurst(t *testing.T) { @@ -359,6 +361,8 @@ func Test_BoundedFrequencyRunnerBurst(t *testing.T) { // Clean up. stop <- struct{}{} + //a message is sent to time.updated in func Stop() at the end of the child goroutine + //to terminate the child, a receive on time.updated is needed here <- time.updated } @@ -443,5 +447,7 @@ func Test_BoundedFrequencyRunnerRetryAfter(t *testing.T) { // Clean up. stop <- struct{}{} + //a message is sent to time.updated in func Stop() at the end of the child goroutine + //to terminate the child, a receive on time.updated is needed here <- time.updated }