-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Labels
Description
=================================== FAILURES ===================================
_________ test_send_remote_failover_sync_non_transport_exception_error _________
should_try = <MagicMock name='should_try' id='139834764165200'>
http_send = <MagicMock name='send' id='139834781896864'>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f2dd1720080>
@mock.patch("elasticapm.transport.http.Transport.send")
@mock.patch("elasticapm.transport.base.TransportState.should_try")
def test_send_remote_failover_sync_non_transport_exception_error(should_try, http_send, caplog):
should_try.return_value = True
client = Client(
server_url="http://example.com/",
service_name="app_name",
secret_token="secret",
transport_class="elasticapm.transport.http.Transport",
metrics_interval="0ms",
metrics_sets=[],
)
# test error
http_send.side_effect = ValueError("oopsie")
with caplog.at_level("ERROR", "elasticapm.transport"):
client.capture_message("foo", handled=False)
> client._transport.flush()
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f2dd1720080>
client = <elasticapm.base.Client object at 0x7f2dd1721f10>
http_send = <MagicMock name='send' id='139834781896864'>
should_try = <MagicMock name='should_try' id='139834764165200'>
tests/client/client_tests.py:294:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <elasticapm.transport.http.Transport object at 0x7f2dd28c87d0>
def flush(self):
"""
Trigger a flush of the queue.
Note: this method will only return once the queue is empty. This means it can block indefinitely if more events
are produced in other threads than can be consumed.
"""
self.queue(None, None, flush=True)
if not self._flushed.wait(timeout=self._max_flush_time_seconds):
> raise ValueError("flush timed out")
E ValueError: flush timed out
self = <elasticapm.transport.http.Transport object at 0x7f2dd28c87d0>
elasticapm/transport/base.py:309: ValueError
---------------------------- Captured log teardown -----------------------------
ERROR elasticapm.transport:base.py:322 Failed to submit message: 'HTTP 403: <HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don\'t have permission to access "http://example.com/intake/v2/events?" on this server.<P>\nReference #18.5ca33017.1753411671.72f44999\n<P>https://errors.edgesuite.net/18.5ca33017.1753411671.72f44999</P>\n</BODY>\n</HTML>\n'