Skip to content

Commit

Permalink
Fix test_clean_removed_with_clean_inactive test (elastic#8093) (elast…
Browse files Browse the repository at this point in the history
…ic#8120)

This removes the time.sleep part from the test in the hope it will make it more stable. I am not 100% confident that this will fully remove the flakyness of test_clean_removed_with_clean_inactive.

If it fails again the future, the full log line + the registry should be added to Github issue to see what is still inside the registry.

Closes elastic#7842

(cherry picked from commit 602f0c3)
  • Loading branch information
ruflin authored and exekias committed Aug 28, 2018
1 parent 4d2f5dc commit 1594960
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions filebeat/tests/system/test_registrar.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,20 +947,15 @@ def test_clean_removed_with_clean_inactive(self):
os.remove(testfile_path1)

# Wait until states are removed from inputs
self.wait_until(
lambda: self.log_contains(
"Remove state for file as file removed"),
max_timeout=15)
self.wait_until(lambda: self.log_contains("Remove state for file as file removed"))

# Add one more line to make sure registry is written
with open(testfile_path2, 'a') as testfile2:
testfile2.write("make sure registry is written\n")

self.wait_until(
lambda: self.output_has(lines=3),
max_timeout=10)

time.sleep(3)
self.wait_until(lambda: self.output_has(lines=3))
# Check is > as the same log line might happen before but afterwards it is repeated
self.wait_until(lambda: self.log_contains_count("Before: 1, After: 1, Pending: 1") > 5)

filebeat.check_kill_and_wait()

Expand Down

0 comments on commit 1594960

Please sign in to comment.