Skip to content

Commit

Permalink
extend health chek to make sure all pings called
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 2, 2021
1 parent 5743109 commit 3eba72c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/proxy/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func TestHttp_healthHandler(t *testing.T) {
fmt.Fprintf(w, "response %s", r.URL.String())
}))

var count int
ps := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
count++
t.Logf("req: %v", r)
if r.URL.Path == "/123/ping" {
return
Expand Down Expand Up @@ -118,6 +120,7 @@ func TestHttp_healthHandler(t *testing.T) {
assert.Equal(t, 2., res["failed"])
assert.Equal(t, 2, len(res["errors"].([]interface{})))
assert.Contains(t, res["errors"].([]interface{})[0], "400 Bad Request")
assert.Equal(t, 3, count, "3 pings for non-assets routes")
}

func TestHttp_pingHandler(t *testing.T) {
Expand Down

0 comments on commit 3eba72c

Please sign in to comment.