def test_submit_failure(self): reporter, sender = self._new_reporter(batch_size=1) reporter.error_reporter = ErrorReporter(metrics=reporter.metrics) # simulate exception in send reporter._send = mock.MagicMock(side_effect=ValueError()) reporter.report_span(self._new_span('1')) yield tornado.gen.sleep(0.001) assert 1 == reporter.metrics.counters[Metrics.REPORTER_FAILURE] # silly test, for code coverage only yield reporter._submit([])
def test_submit_failure(self): reporter, sender = self._new_reporter(batch_size=1) reporter.error_reporter = ErrorReporter(metrics=reporter.metrics, logger=logging.getLogger()) assert Metrics.REPORTER_FAILURE not in reporter.metrics.counters # simulate exception in send reporter._send = mock.MagicMock(side_effect=ValueError()) reporter.report_span(self._new_span('1')) yield self._wait_for( lambda: Metrics.REPORTER_FAILURE in reporter.metrics.counters) assert 1 == reporter.metrics.counters.get(Metrics.REPORTER_FAILURE) # silly test, for code coverage only yield reporter._submit([])
def test_submit_failure(self): reporter, sender = self._new_reporter(batch_size=1) reporter.error_reporter = ErrorReporter(metrics=Metrics(), logger=logging.getLogger()) reporter_failure_key = 'jaeger:reporter_spans.result_err' assert reporter_failure_key not in reporter.metrics_factory.counters # simulate exception in send reporter._send = mock.MagicMock(side_effect=ValueError()) reporter.report_span(self._new_span('1')) yield self._wait_for( lambda: reporter_failure_key in reporter.metrics_factory.counters) assert 1 == reporter.metrics_factory.counters.get(reporter_failure_key) # silly test, for code coverage only yield reporter._submit([])
def test_submit_failure(self): reporter, sender = self._new_reporter(batch_size=1) reporter.error_reporter = ErrorReporter( metrics=Metrics(), logger=logging.getLogger()) reporter_failure_key = 'jaeger:reporter_spans.result_err' assert reporter_failure_key not in reporter.metrics_factory.counters # simulate exception in send reporter._send = mock.MagicMock(side_effect=ValueError()) reporter.report_span(self._new_span('1')) yield self._wait_for( lambda: reporter_failure_key in reporter.metrics_factory.counters) assert 1 == reporter.metrics_factory.counters.get(reporter_failure_key) # silly test, for code coverage only yield reporter._submit([])