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

Test auto removal #345

Merged
merged 8 commits into from
Sep 19, 2023
Merged
Prev Previous commit
Next Next commit
Fix path and reduce log lines to speed test up.
  • Loading branch information
adam-mateen committed Sep 15, 2023
commit 24a9944303c1dc3db92b41539ceb45eda6a4aeaa
4 changes: 2 additions & 2 deletions test/cloudwatchlogs/publish_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ func TestAutoRemovalStopAgent(t *testing.T) {
defer awsservice.DeleteLogGroupAndStream(instanceId, instanceId)
configPath := "resources/config_auto_removal.json"
fpath := logFilePath + "1"
f, err := os.Create(logFilePath)
f, err := os.Create(fpath)
if err != nil {
t.Fatalf("Error occurred creating log file for writing: %v", err)
}
defer f.Close()
defer os.Remove(fpath)
common.StartAgent(configPath, true, false)
time.Sleep(agentRuntime)
writeLogs(t, f, 100_000)
writeLogs(t, f, 1000)
common.StopAgent()
time.Sleep(agentRuntime)
assert.FileExists(t, fpath, "file does not exist, {}", fpath)
Expand Down