def METHOD_NAME(self):
    """
    Metrics: Check that servfail metrics are correctly updated for server failures
    """
    for method in ("sendUDPQuery", "sendTCPQuery", "sendDOTQueryWrapper", "sendDOHQueryWrapper"):
        qname = method + '.servfail.cache.metrics.tests.powerdns.com.'
        query = dns.message.make_query(qname, 'A', 'IN')
        # dnsdist set RA = RD for spoofed responses
        query.flags &= ~dns.flags.RD
        response = dns.message.make_response(query)
        response.set_rcode(dns.rcode.SERVFAIL)
        frontendBefore = self.getMetric('frontend-servfail')
        servfailBefore = self.getMetric('servfail-responses')
        ruleBefore = self.getMetric('rule-servfail')
        sender = getattr(self, method)
        # first time, cache miss
        (receivedQuery, receivedResponse) = sender(query, response)
        receivedQuery.id = query.id
        self.assertEqual(query, receivedQuery)
        self.assertEqual(receivedResponse, response)
        # second time, hit
        (_, receivedResponse) = sender(query, response=None, useQueue=False)
        self.assertEqual(receivedResponse, response)
        self.assertEqual(self.getMetric('frontend-servfail'), frontendBefore + 2)
        self.assertEqual(self.getMetric('servfail-responses'), servfailBefore + 1)
        self.assertEqual(self.getMetric('rule-servfail'), ruleBefore)