diff --git a/filebeat/tests/system/test_crawler.py b/filebeat/tests/system/test_crawler.py index ed3e2c50f53a..53caea94fa68 100644 --- a/filebeat/tests/system/test_crawler.py +++ b/filebeat/tests/system/test_crawler.py @@ -568,7 +568,8 @@ def test_encodings(self): for _, enc_py, text in encodings: with codecs.open(self.working_dir + "/log/test-{}".format(enc_py), "w", enc_py) as f: - f.write(text + "\n") + f.write(text + "\n") + f.close() # create the config file inputs = [] @@ -592,6 +593,7 @@ def test_encodings(self): with codecs.open(self.working_dir + "/log/test-{}".format(enc_py), "a", enc_py) as f: f.write(text + " 2" + "\n") + f.close() # wait again self.wait_until(lambda: self.output_has(lines=len(encodings) * 2),