INNER CODE UNIT · Go

TestServiceHealthScheduledCollectionIncludesRegisteredOrganization

VersusControl/versus-incident · cmd/main_test.go:75

func TestServiceHealthScheduledCollectionIncludesRegisteredOrganization(t *testing.T) {
	scheduler.Reset()
	scheduler.SetOwnership(nil)
	servicehealth.SetOrganizationLister(func(context.Context) ([]string, error) { return []string{"org-a"}, nil })
	t.Cleanup(func() {
		scheduler.Reset()
		scheduler.SetOwnership(nil)
		servicehealth.SetOrganizationLister(nil)
	})
	store := storage.NewMemory()
	manager := servicehealth.NewManager(store)
	if err := startServiceHealth(manager, store, nil, c.AgentConfig{}, nil); err != nil {
		t.Fatal(err)
	}
	jobs := scheduler.Registered()
	if len(jobs) != 1 {
		t.Fatalf("registered jobs = %#v", jobs)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…