Skip to content

Commit

Permalink
test_crawler: close and flush files during whe test
Browse files Browse the repository at this point in the history
  • Loading branch information
pazone authored and oakrizan committed Jan 9, 2024
1 parent 35e1574 commit 3a73ac8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion filebeat/tests/system/test_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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),
Expand Down

0 comments on commit 3a73ac8

Please sign in to comment.