elastic / elastic/elastic-agent

[Flaky Test] github.com/elastic/fleet-server/testing/e2e TestStandAloneRunningSuite/TestAgentGracefulForceUnenroll

Open
#16,299 6 comments 0 reactions 0 assignees View on GitHub
flaky-test
Dominant language
Go
Stars
275
Forks
264
Avg merge
1d 23h
Merged PRs (30d)
312

Description

## Flaky Test

* **Test Name:** TestStandAloneRunningSuite/TestAgentGracefulForceUnenroll
* **Scope:** github.com/elastic/fleet-server/testing/e2e
* **File:** N/A
* **Location:** N/A
* **Buildkite Link:** https://buildkite.com/organizations/elastic/analytics/suites/elastic-agent-ci/tests/c2f59ae4-6cc1-881b-8080-50af95c8299e
* **Flaky Instances:** 1
* **Latest Occurrence:** 2026-08-20T16:43:29.472Z

### Details

```json
{
"id": "c2f59ae4-6cc1-881b-8080-50af95c8299e",
"web_url": "https://buildkite.com/organizations/elastic/analytics/suites/elastic-agent-ci/tests/c2f59ae4-6cc1-881b-8080-50af95c8299e",
"scope": "github.com/elastic/fleet-server/testing/e2e",
"name": "TestStandAloneRunningSuite/TestAgentGracefulForceUnenroll",
"location": null,
"file_name": null,
"instances": 1,
"latest_occurrence_at": "2026-08-20T16:43:29.472Z",
"most_recent_instance_at": "2026-08-20T16:43:29.472Z",
"last_resolved_at": null,
"ownership_team_ids": [],
"failure_examples_count": 1
}
```

### Failure Examples

**Example 1:**
**Run:** https://api.buildkite.com/v2/analytics/organizations/elastic/suites/elastic-agent-ci/runs/21568f61-12f1-89d1-8434-118c56908051
**Time:** 2026-08-20T15:58:21.898Z
**Stacktrace:**

```
stand_alone_test.go:753: Using version 9.6.0-SNAPSHOT for agent download
stand_alone_test.go:753: Using cached elastic-agent from /tmp/fleet-server-e2e/elastic-agent-9.6.0-SNAPSHOT-linux-x86_64.tar.gz
stand_alone_test.go:820: enroll output:
{"log.level":"info","@timestamp":"2026-08-20T16:02:16.470Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/application/enroll.EnrollWithBackoff","file.name":"enroll/enroll.go","file.line":87},"message":"Starting enrollment to URL: https://localhost:8220/","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2026-08-20T16:02:17.546Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).Execute","file.name":"cmd/enroll_cmd.go","file.line":210},"message":"Elastic Agent has been enrolled; start Elastic Agent","ecs.version":"1.6.0"}
Successfully enrolled the Elastic Agent.
stand_alone_test.go:860: Waiting for enrolled agent to appear online in Kibana...
stand_alone_test.go:876: agent 0afbd5b5-dc85-4dd9-b3ad-02ef6c49b9da status=updating
stand_alone_test.go:885: Agent 0afbd5b5-dc85-4dd9-b3ad-02ef6c49b9da is active and checking in
stand_alone_test.go:889: Invalidating agent API key Jo_oH6ABTx88FTrTqpbl
stand_alone_test.go:901: Waiting for elastic-agent to have no running components (step 1: POLICY_CHANGE)...
stand_alone_test.go:902:
Error Trace: /opt/buildkite-agent/builds/bk-agent-prod-gcp-1787240502502178515/elastic/fleet-server/testing/e2e/stand_alone_test.go:902
/opt/buildkite-agent/.gvm/versions/go1.26.6.linux.amd64/src/runtime/asm_amd64.s:1771
Error: Condition never satisfied
Test: TestStandAloneRunningSuite/TestAgentGracefulForceUnenroll
Messages: elastic-agent still has running components after empty policy was applied
```

Contributor guide

Open the contributing guide

Research direction

Start in testing/e2e/stand_alone_test.go around line 902 and review TestStandAloneRunningSuite/TestAgentGracefulForceUnenroll, using the linked Buildkite run and failure output. Reproduce or inspect the transition after the empty policy is applied; done means the test reliably observes no running components without timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.