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 }