Skip to content

More transport flaky tests #2382

@xrmx

Description

@xrmx
____________ test_flushed_arg_with_wait[sending_elasticapm_client0] ____________

sending_elasticapm_client = <elasticapm.base.Client object at 0x7fd3196c13d0>

    @pytest.mark.skipif(platform.system() == "Windows", reason="Flaky test on windows")
    @pytest.mark.flaky(reruns=3)  # Trying to test automatic flushes is inherently flaky
    @pytest.mark.parametrize("sending_elasticapm_client", [{"api_request_time": "100ms"}], indirect=True)
    def test_flushed_arg_with_wait(sending_elasticapm_client):
        sending_elasticapm_client.begin_transaction("test_type")
        sending_elasticapm_client.end_transaction("test")
        time.sleep(0.3)
        sending_elasticapm_client._transport.flush()
    
>       assert sending_elasticapm_client.httpserver.requests[1].args["flushed"] == "true"
E       IndexError: list index out of range

sending_elasticapm_client = <elasticapm.base.Client object at 0x7fd3196c13d0>

tests/transports/test_base.py:289: IndexError
----------------------------- Captured stderr call -----------------------------
{"@timestamp":"2025-08-04T02:52:17.556Z","log.level":"info","message":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events HTTP/1.1\u001b[0m\" 202 -","ecs.version":"1.6.0","log":{"logger":"werkzeug","origin":{"file":{"line":97,"name":"_internal.py"},"function":"_log"},"original":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events HTTP/1.1\u001b[0m\" 202 -"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544533587648,"name":"<class 'tests.fixtures.ValidatingWSGIApp'>"}},"service":{"name":"myapp"}}
127.0.0.1 - - [04/Aug/2025 02:52:17] "POST /intake/v2/events HTTP/1.1" 202 -
------------------------------ Captured log call -------------------------------
{"@timestamp":"2025-08-04T02:52:17.556Z","log.level":"info","message":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events HTTP/1.1\u001b[0m\" 202 -","ecs.version":"1.6.0","log":{"logger":"werkzeug","origin":{"file":{"line":97,"name":"_internal.py"},"function":"_log"},"original":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events HTTP/1.1\u001b[0m\" 202 -"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544533587648,"name":"<class 'tests.fixtures.ValidatingWSGIApp'>"}},"service":{"name":"myapp"}}
--------------------------- Captured stderr teardown ---------------------------
{"@timestamp":"2025-08-04T02:52:17.761Z","log.level":"info","message":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events?flushed=true HTTP/1.1\u001b[0m\" 202 -","ecs.version":"1.6.0","log":{"logger":"werkzeug","origin":{"file":{"line":97,"name":"_internal.py"},"function":"_log"},"original":"127.0.0.1 - - [04/Aug/2025 02:52:17] \"\u001b[35m\u001b[1mPOST /intake/v2/events?flushed=true HTTP/1.1\u001b[0m\" 202 -"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544533587648,"name":"<class 'tests.fixtures.ValidatingWSGIApp'>"}},"service":{"name":"myapp"}}
127.0.0.1 - - [04/Aug/2025 02:52:17] "POST /intake/v2/events?flushed=true HTTP/1.1" 202 -
----------------------------- Captured stderr call -----------------------------
{"@timestamp":"2025-08-04T02:52:18.380Z","log.level":"warning","message":"Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d910>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d910>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d910>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events
{"@timestamp":"2025-08-04T02:52:18.382Z","log.level":"warning","message":"Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d1f0>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d1f0>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d1f0>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events
{"@timestamp":"2025-08-04T02:52:18.383Z","log.level":"warning","message":"Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d220>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d220>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d220>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events
{"@timestamp":"2025-08-04T02:52:18.384Z","log.level":"error","message":"Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'","ecs.version":"1.6.0","log":{"logger":"elasticapm.transport","origin":{"file":{"line":322,"name":"base.py"},"function":"handle_transport_fail"},"original":"Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'
{"@timestamp":"2025-08-04T02:52:18.579Z","log.level":"warning","message":"Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d490>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d490>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd31983d490>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true
{"@timestamp":"2025-08-04T02:52:18.580Z","log.level":"warning","message":"Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5c10>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5c10>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5c10>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true
{"@timestamp":"2025-08-04T02:52:18.582Z","log.level":"warning","message":"Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5310>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true","ecs.version":"1.6.0","log":{"logger":"urllib3.connectionpool","origin":{"file":{"line":868,"name":"connectionpool.py"},"function":"urlopen"},"original":"Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5310>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd319cb5310>: Failed to establish a new connection: [Errno 111] Connection refused')': /intake/v2/events?flushed=true
{"@timestamp":"2025-08-04T02:52:18.583Z","log.level":"error","message":"Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'","ecs.version":"1.6.0","log":{"logger":"elasticapm.transport","origin":{"file":{"line":322,"name":"base.py"},"function":"handle_transport_fail"},"original":"Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'"},"process":{"name":"MainProcess","pid":38,"thread":{"id":140544550368960,"name":"eapm event processor thread"}},"service":{"name":"myapp"}}
Failed to submit message: 'Connection to APM Server timed out (url: http://127.0.0.1:43915/intake/v2/events, timeout: 5 seconds)'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions