[PLT-5465/APIV4] GET /system/health - Improve ping health check to have limits (#6331)

* implement PLT-5465 - Improve ping health check to have limits

* update /ping and delete /health

* remove permission check
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-05-31 06:47:27 +02:00
коммит произвёл Corey Hulen
родитель 0e4add96ae
Коммит ddc996f33f
6 изменённых файлов: 53 добавлений и 13 удалений

Просмотреть файл

@@ -12,13 +12,26 @@ import (
)
func TestGetPing(t *testing.T) {
th := Setup().InitBasic()
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()
Client := th.Client
b, _ := Client.GetPing()
if b == false {
t.Fatal()
goRoutineHealthThreshold := *utils.Cfg.ServiceSettings.GoroutineHealthThreshold
defer func() {
*utils.Cfg.ServiceSettings.GoroutineHealthThreshold = goRoutineHealthThreshold
}()
status, resp := Client.GetPing()
CheckNoError(t, resp)
if status != "OK" {
t.Fatal("should return OK")
}
*utils.Cfg.ServiceSettings.GoroutineHealthThreshold = 10
status, resp = th.SystemAdminClient.GetPing()
CheckInternalErrorStatus(t, resp)
if status != "unhealthy" {
t.Fatal("should return unhealthy")
}
}
@@ -342,5 +355,4 @@ func TestPostLog(t *testing.T) {
if len(logMessage) == 0 {
t.Fatal("should return the log message")
}
}