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

[8.15](backport #5329) Fixes issue where context cancelling could result in an invalid error being reported #5482

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ func (f *FleetGateway) doExecute(ctx context.Context, bo backoff.Backoff) (*flee
}

if !bo.Wait() {
// Something bad has happened and we log it and we should update our current state.
if ctx.Err() != nil {
// if the context is cancelled, break out of the loop
break
}

// This should not really happen, but just in-case this error is used to show that
// something strange occurred and we want to log it and report it.
err := errors.New(
"checkin retry loop was stopped",
errors.TypeNetwork,
Expand Down
5 changes: 0 additions & 5 deletions testing/integration/endpoint_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@ func testInstallAndUnenrollWithEndpointSecurity(t *testing.T, info *define.Info,
return false
}

if state.FleetState != client.Failed {
t.Logf("Fleet state has not been marked as failed yet!\n%+v", state)
return false
}

return true
},
endpointHealthPollingTimeout,
Expand Down
2 changes: 0 additions & 2 deletions testing/integration/linux_rpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func TestRpmLogIngestFleetManaged(t *testing.T) {
Sudo: true,
})

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

ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute))
defer cancel()

Expand Down