Skip to content

Broken/Flaky filebeat.tests.system.test_udp.Test.test_udp #22809

@kvch

Description

@kvch

The UDP tests on Windows seem to be failing from time to time.

Error message:

beat.beat.TimeoutError: Timeout waiting for 'cond' to be true. Waited 10 seconds.

self = <test_udp.Test testMethod=test_udp>

        def test_udp(self):
    
            host = "127.0.0.1"
            port = 8080
            input_raw = """
    - type: udp
      host: "{}:{}"
      enabled: true
    """
    
            input_raw = input_raw.format(host, port)
    
            self.render_config_template(
                input_raw=input_raw,
                inputs=False,
            )
    
            filebeat = self.start_beat()
    
            self.wait_until(lambda: self.log_contains("Started listening for UDP connection"))
    
            sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)  # UDP
    
            for n in range(0, 2):
                sock.sendto(b"Hello World: " + n.to_bytes(2, "big"), (host, port))
    
>           self.wait_until(lambda: self.output_count(lambda x: x >= 2))

tests\system\test_udp.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <test_udp.Test testMethod=test_udp>
cond = <function Test.test_udp.<locals>.<lambda> at 0x0000018D2FFAA940>
max_timeout = 10, poll_interval = 0.1, name = 'cond'

    def wait_until(self, cond, max_timeout=10, poll_interval=0.1, name="cond"):
        """
        Waits until the cond function returns true,
        or until the max_timeout is reached. Calls the cond
        function every poll_interval seconds.
    
        If the max_timeout is reached before cond() returns
        true, an exception is raised.
        """
        start = datetime.now()
        while not cond():
            if datetime.now() - start > timedelta(seconds=max_timeout):
>               raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                                   "Waited {} seconds.".format(max_timeout))
E               beat.beat.TimeoutError: Timeout waiting for 'cond' to be true. Waited 10 seconds.

..\libbeat\tests\system\beat\beat.py:362: TimeoutError

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalledTeam:Services(Deprecated) Label for the former Integrations-Services teamflaky-testUnstable or unreliable test cases.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions