From c8900d3f2deced7c2e73ec742142c780f7013c66 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Tue, 28 Aug 2018 13:39:26 +0200 Subject: [PATCH] Fix flaky clean_removed test (#8092) This is a potential fix for the flaky clean_removed test. The problem in the test seems to be that sometimes not all states are cleaned up yet. This is changing it by waiting for all pending cleanups to happen. Closes https://github.com/elastic/beats/issues/7690 (cherry picked from commit e34629335487d388c1bb881e73682265ab05ac88) --- filebeat/tests/system/test_registrar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filebeat/tests/system/test_registrar.py b/filebeat/tests/system/test_registrar.py index dd74266fa81..42f8d7ea0f6 100644 --- a/filebeat/tests/system/test_registrar.py +++ b/filebeat/tests/system/test_registrar.py @@ -895,6 +895,9 @@ def test_clean_removed(self): lambda: self.output_has(lines=3), max_timeout=10) + # Make sure all states are cleaned up + self.wait_until(lambda: self.log_contains("Before: 1, After: 1, Pending: 0")) + filebeat.check_kill_and_wait() # Check that the first to files were removed from the registry