Skip to content

Flaky Test [Initializing / Test / windows-3.8-none / test_send_remote_failover_sync[validating_httpserver0-sending_elasticapm_client0] – tests.client.client_tests] #1306

@ghost

Description

Flaky Test

Error details

AssertionError 

Stack Trace

should_try = <MagicMock name="should_try" id="2387705179872"> sending_elasticapm_client = <elasticapm.base.Client object at 0x0000022BEE657BE0> caplog = <_pytest.logging.LogCaptureFixture object at 0x0000022BEE51A940> @pytest.mark.flaky(reruns=3) # test is flaky on Windows @pytest.mark.parametrize( "sending_elasticapm_client", [{"transport_class": "elasticapm.transport.http.Transport", "async_mode": False}], indirect=True, ) @pytest.mark.parametrize("validating_httpserver", [{"app": ContentServer}], indirect=True) @mock.patch("elasticapm.transport.base.TransportState.should_try") def test_send_remote_failover_sync(should_try, sending_elasticapm_client, caplog): sending_elasticapm_client.httpserver.code = 400 sending_elasticapm_client.httpserver.content = "go away" should_try.return_value = True # test error with caplog.at_level("ERROR", "elasticapm.transport"): sending_elasticapm_client.capture_message("foo", handled=False) sending_elasticapm_client._transport.flush() assert sending_elasticapm_client._transport.state.did_fail() > assert_any_record_contains(caplog.records, "go away") tests\client\client_tests.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ records = [<LogRecord: urllib3.connectionpool, 30, C:\Users\jenkins\workspace\thon_apm-agent-python-mbp_PR-824\src\github.com\el...-mbp_PR-824\src\github.com\elastic\apm-agent-python\elasticapm\transport\base.py, 297, "Failed to submit message: %r">] message = "go away", logger = None def assert_any_record_contains(records, message, logger=None): > assert any( message in record.message for record in (record for record in records if logger is None or record.name == logger) ) E AssertionError tests\utils\__init__.py:33: AssertionError 

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-pythonci-reportedIssues that have been automatically reported from the CIflaky-testUnstable or unreliable test cases.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions