From 13c99b58d9ed9edf21218b70edb9cef336654f11 Mon Sep 17 00:00:00 2001 From: woodsaj Date: Wed, 9 Nov 2016 15:17:05 +0800 Subject: [PATCH] add comment to explain sleep. --- input/carbon/carbon_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/input/carbon/carbon_test.go b/input/carbon/carbon_test.go index 41522d384c..2bfd29034d 100644 --- a/input/carbon/carbon_test.go +++ b/input/carbon/carbon_test.go @@ -105,6 +105,8 @@ func test_handleMessage(worker int, t *testing.T) map[string]int { t.Fatal(err) } } + // as soon as this function ends, the server will close the socket. We need to sleep here + // to ensure that the packets have time to be procesed by the kernel and passed to the server. time.Sleep(time.Millisecond * 100) return metrics }