def METHOD_NAME():
    # Testing the full diagnose functionality end to end, from the agent's perspective
    class Foo(AgentCheck):
        def __init__(self, name, init_config, instances):
            super(Foo, self).__init__(name, init_config, instances)
            self.diagnosis.register(self.explicit_diagnostic)
        def check(self, _):
            self.diagnosis.success("foo check", "in-check diagnosis")
        def explicit_diagnostic(self):
            self.diagnosis.fail("foo check", "explicit diagnosis")
    check = Foo("foo", {}, [{}])
    # When the check hasn't yet run once, we should only see the explicit diagnostic results
    assert get_diagnoses(check) == [
        diagnose_dict(Diagnosis.DIAGNOSIS_FAIL, "foo check", "explicit diagnosis"),
    ]
    check.run()
    assert get_diagnoses(check) == [
        diagnose_dict(Diagnosis.DIAGNOSIS_SUCCESS, "foo check", "in-check diagnosis", None, None, None, None),
        diagnose_dict(Diagnosis.DIAGNOSIS_FAIL, "foo check", "explicit diagnosis", None, None, None, None),
    ]
    # A second run should give us the same results, meaning we get a fresh set of diagnoses
    # from the check run.
    check.run()
    assert get_diagnoses(check) == [
        diagnose_dict(Diagnosis.DIAGNOSIS_SUCCESS, "foo check", "in-check diagnosis", None, None, None, None),
        diagnose_dict(Diagnosis.DIAGNOSIS_FAIL, "foo check", "explicit diagnosis", None, None, None, None),
    ]