elastic / elastic/beats

[Flaky Test] github.com/elastic/beats/v7/x-pack/heartbeat/monitors/browser/synthexec TestRunBadExitCodeCmd

Open
#52,837 2 comments 1 reaction 0 assignees View on GitHub
flaky-test needs_team
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 2h
Merged PRs (30d)
364

Description

## Flaky Test

* **Test Name:** TestRunBadExitCodeCmd
* **Scope:** github.com/elastic/beats/v7/x-pack/heartbeat/monitors/browser/synthexec
* **File:** N/A
* **Location:** N/A
* **Buildkite Link:** https://buildkite.com/organizations/elastic/analytics/suites/beats/tests/9acde42a-28b8-8dc2-ad72-7426bd337860
* **Flaky Instances:** 1
* **Latest Occurrence:** 2026-08-25T04:17:08.588Z

### Details

```json
{
"id": "9acde42a-28b8-8dc2-ad72-7426bd337860",
"web_url": "https://buildkite.com/organizations/elastic/analytics/suites/beats/tests/9acde42a-28b8-8dc2-ad72-7426bd337860",
"scope": "github.com/elastic/beats/v7/x-pack/heartbeat/monitors/browser/synthexec",
"name": "TestRunBadExitCodeCmd",
"location": null,
"file_name": null,
"instances": 1,
"latest_occurrence_at": "2026-08-25T04:17:08.588Z",
"most_recent_instance_at": "2026-08-25T04:17:08.588Z",
"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/beats/runs/8e3026ff-8ef3-8326-a37a-24a88af5c642
**Time:** 2026-08-25T04:10:14.333Z
**Stacktrace:**

```
=== RUN TestRunBadExitCodeCmd
synthexec_test.go:245:
Error Trace: /opt/buildkite-agent/builds/bk-agent-prod-gcp-1787630743885569809/elastic/beats-xpack-heartbeat/x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go:245
Error: "[0x30be4b6d0210]" should have 2 item(s), but has 1
Test: TestRunBadExitCodeCmd
--- FAIL: TestRunBadExitCodeCmd (0.73s)

```

Contributor guide

Open the contributing guide

Research direction

Start with x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go at line 245 and run TestRunBadExitCodeCmd. Compare the local failure with the linked Buildkite run to identify why the assertion sometimes sees one item instead of two. Done means the test passes reliably without hiding the intended bad-exit-code behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.