forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case to reproduce panic on Filebeat shutdown
The test is skipped until elastic#964 is addressed.
- Loading branch information
1 parent
79bd08a
commit 811bf08
Showing
5 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Ignore all temp files | ||
tmp* | ||
nasa-50k.log |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from filebeat import BaseTest | ||
import gzip | ||
import os | ||
import time | ||
import unittest | ||
|
||
""" | ||
Tests that Filebeat shuts down cleanly. | ||
""" | ||
|
||
class Test(BaseTest): | ||
@unittest.skip("Needs fix from #964") | ||
def test_shutdown(self): | ||
""" | ||
Test starting and stopping Filebeat under load. | ||
""" | ||
|
||
# Uncompress the nasa log file. | ||
nasa_log = '../files/logs/nasa-50k.log' | ||
if not os.path.isfile(nasa_log): | ||
with gzip.open('../files/logs/nasa-50k.log.gz', 'rb') as infile: | ||
with open(nasa_log, 'w') as outfile: | ||
for line in infile: | ||
outfile.write(line) | ||
|
||
self.render_config_template( | ||
path=os.path.abspath(self.working_dir) + "/log/*", | ||
ignoreOlder="1h" | ||
) | ||
|
||
os.mkdir(self.working_dir + "/log/") | ||
self.copy_files(["logs/nasa-50k.log"], | ||
source_dir="../files", | ||
target_dir="log") | ||
|
||
for i in range(1,5): | ||
proc = self.start_beat(logging_args=["-e", "-v"]) | ||
time.sleep(.5) | ||
proc.check_kill_and_wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters