healthz
healthz copied to clipboard
Support stateful tests
Hey!
I would like to add some custom tests that check something on an instance of my server. For example
s := &Server{
database: MyDatabase
}
healthz.RegisterTest("db-alive", s.checkDb)
Where checkDb
would implement TestFunc
. However, since the registry is global, the above is problematic. Things like tests, where I will make several instances of my Server, will panic.
Would it be possible to use a non-global registry? Or support this use case some other way?
Thanks!