Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto_removal feature so log lines are NOT dropped from old file #452

Merged
merged 8 commits into from
May 16, 2022
4 changes: 3 additions & 1 deletion plugins/inputs/logfile/logfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ func createWriteRead(t *testing.T, prefix string, logFile *LogFile, done chan bo
logSrc, evts := getLogSrc(t, logFile)
defer (*logSrc).Stop()
defer close(evts)
const numLines int = 1000
// Choose a large enough number of lines so that even high-spec hosts will not
// complete receiving logEvents before the 2nd createWriteRead() goroutine begins.
const numLines int = 100000
SaxyPandaBear marked this conversation as resolved.
Show resolved Hide resolved
const msg string = "this is the best log line ever written to a file"
writeLines(t, file, numLines, msg)
file.Close()
Expand Down