mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-14 08:58:27 +08:00
### Summary 1. update docker compose file to start NATS healthy 2. Add two commands ``` RAGFlow(admin)> live; SUCCESS RAGFlow(admin)> health; +---------------+-------+ | field | value | +---------------+-------+ | storage | ok | | message_queue | ok | | status | ok | | db | ok | | redis | ok | | doc_engine | ok | +---------------+-------+ ``` --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
20 lines
597 B
Go
20 lines
597 B
Go
package service
|
|
|
|
import "testing"
|
|
|
|
func TestSystemServiceHealthzReportsUnhealthyDependencies(t *testing.T) {
|
|
result, allOK := NewSystemService().Healthz(t.Context())
|
|
if allOK {
|
|
t.Fatal("allOK=true, want false without initialized dependencies")
|
|
}
|
|
if result.Status != "nok" {
|
|
t.Fatalf("status=%q, want nok", result.Status)
|
|
}
|
|
if result.DB != "nok" || result.Redis != "nok" || result.DocEngine != "nok" || result.Storage != "nok" || result.MessageQueue != "nok" {
|
|
t.Fatalf("unexpected health result: %+v", result)
|
|
}
|
|
if len(result.Meta) == 0 {
|
|
t.Fatal("expected failure metadata")
|
|
}
|
|
}
|