Fix flaky healthcheck test
This commit is contained in:
parent
580e7fa774
commit
268d1edc8f
1 changed files with 2 additions and 0 deletions
|
@ -135,6 +135,8 @@ func newHTTPServer(healthSequence ...int) *HTTPServer {
|
|||
func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
|
||||
if s.status.IsEmpty() {
|
||||
s.done()
|
||||
// This ensures that the health-checker will handle the context cancellation error before receiving the HTTP response.
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue