diff --git a/testing/integration/upgrade_fleet_test.go b/testing/integration/upgrade_fleet_test.go index fd281333ace..9c44386eb87 100644 --- a/testing/integration/upgrade_fleet_test.go +++ b/testing/integration/upgrade_fleet_test.go @@ -146,7 +146,7 @@ func testUpgradeFleetManagedElasticAgent(ctx context.Context, t *testing.T, info require.NoError(t, err) require.Eventually(t, func() bool { agent, err := fleettools.GetAgentByPolicyIDAndHostnameFromList(kibClient, policy.ID, hostname) - return err != nil && agent.UpgradeDetails != nil + return err == nil && agent.UpgradeDetails != nil }, 5*time.Minute, time.Second)