Skip to content

Commit

Permalink
Fix TestEventLogFile (#5341)
Browse files Browse the repository at this point in the history
Fix TestEventLogFile by updating the string that needs to be searched
in the logs.
  • Loading branch information
belimawr authored Aug 22, 2024
1 parent b060fd2 commit b96a4ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion testing/integration/container_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func TestContainerCMDEventToStderr(t *testing.T) {
agentOutputStr := agentOutput.String()
scanner := bufio.NewScanner(strings.NewReader(agentOutputStr))
for scanner.Scan() {
if strings.Contains(scanner.Text(), "Cannot index event publisher.Event") {
if strings.Contains(scanner.Text(), "Cannot index event") {
return true
}
}
Expand Down
7 changes: 2 additions & 5 deletions testing/integration/event_logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ func TestEventLogFile(t *testing.T) {
Sudo: false,
})

t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/5337")

ctx, cancel := testcontext.WithDeadline(
t,
context.Background(),
Expand Down Expand Up @@ -165,7 +163,6 @@ func TestEventLogOutputConfiguredViaFleet(t *testing.T) {
},
Group: "container",
})
t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/5159")

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
Expand Down Expand Up @@ -257,7 +254,7 @@ func TestEventLogOutputConfiguredViaFleet(t *testing.T) {
agentOutputStr := agentOutput.String()
scanner := bufio.NewScanner(strings.NewReader(agentOutputStr))
for scanner.Scan() {
if strings.Contains(scanner.Text(), "Cannot index event publisher.Event") {
if strings.Contains(scanner.Text(), "Cannot index event") {
return true
}
}
Expand Down Expand Up @@ -343,7 +340,7 @@ func requireEventLogFileExistsWithData(t *testing.T, agentFixture *atesting.Fixt
}

logEntry := string(logEntryBytes)
expectedStr := "Cannot index event publisher.Event"
expectedStr := "Cannot index event"
if !strings.Contains(logEntry, expectedStr) {
t.Errorf(
"did not find the expected log entry ('%s') in the events log file",
Expand Down

0 comments on commit b96a4ca

Please sign in to comment.