Error
beat.beat.TimeoutError: Timeout waiting for 'cond' to be true. Waited 10 seconds.
Stacktrace
self = <test_lightmodules.Test testMethod=test_processors>
def test_processors(self):
shutil.copytree(
os.path.join(self.beat_path, "mb/testing/testdata/lightmodules"),
os.path.join(self.working_dir, "module"),
)
with http_test_server() as server:
self.render_config_template(modules=[{
"name": "test",
"metricsets": ["json"],
"namespace": "test",
# Hard-coding 'localhost' because hostname in server.server_name doesn't always work.
"hosts": [f"localhost:{server.server_port}"],
}])
proc = self.start_beat()
> self.wait_until(lambda: self.output_lines() > 0)
tests\system\test_lightmodules.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_lightmodules.Test testMethod=test_processors>
cond = <function Test.test_processors.<locals>.<lambda> at 0x000001A0D352B790>
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
Flaky Test
test_lightmodules.TestStack Trace