mirror of
https://github.com/umputun/reproxy.git
synced 2024-09-11 08:55:25 +03:00
extend health chek to make sure all pings called
This commit is contained in:
parent
5743109210
commit
3eba72cbff
@ -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
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user