Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
add comment to explain sleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsaj committed Nov 9, 2016
1 parent f750591 commit 13c99b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions input/carbon/carbon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 13c99b5

Please sign in to comment.