From c84998e996176c5f55fe92c37d472d0763d99a73 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 18 Dec 2018 16:53:18 -0800 Subject: [PATCH] tests: implement HasHealth for mock health --- client/allocrunner/health_hook_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/allocrunner/health_hook_test.go b/client/allocrunner/health_hook_test.go index cb2b3d7d1..8882f6711 100644 --- a/client/allocrunner/health_hook_test.go +++ b/client/allocrunner/health_hook_test.go @@ -76,6 +76,12 @@ func (m *mockHealthSetter) ClearHealth() { m.taskEvents = nil } +func (m *mockHealthSetter) HasHealth() bool { + m.mu.Lock() + defer m.mu.Unlock() + return m.healthy != nil +} + // TestHealthHook_PrerunPostrun asserts a health hook does not error if it is // run and postrunned. func TestHealthHook_PrerunPostrun(t *testing.T) {