elastic / elastic/beats

[Flaky Test] github.com/elastic/beats/v7/x-pack/filebeat/input/cometd TestNegativeCases

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

Description

## Flaky Test

* **Test Name:** TestNegativeCases
* **Scope:** github.com/elastic/beats/v7/x-pack/filebeat/input/cometd
* **File:** N/A
* **Location:** N/A
* **Buildkite Link:** https://buildkite.com/organizations/elastic/analytics/suites/beats/tests/95c91c23-6d42-8e4c-9778-3384b5cfccd6
* **Flaky Instances:** 1
* **Latest Occurrence:** 2026-08-05T04:25:15.929Z

### Details

```json
{
"id": "95c91c23-6d42-8e4c-9778-3384b5cfccd6",
"web_url": "https://buildkite.com/organizations/elastic/analytics/suites/beats/tests/95c91c23-6d42-8e4c-9778-3384b5cfccd6",
"scope": "github.com/elastic/beats/v7/x-pack/filebeat/input/cometd",
"name": "TestNegativeCases",
"location": null,
"file_name": null,
"instances": 1,
"latest_occurrence_at": "2026-08-05T04:25:15.929Z",
"most_recent_instance_at": "2026-08-05T04:25:15.929Z",
"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/3440da9b-0fbd-8681-a2c5-a2f5aeb4d5b4
**Time:** 2026-08-05T04:10:33.443Z
**Stacktrace:**

```
=== RUN TestNegativeCases
panic: send on closed channel

goroutine 81 [running]:
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.TestMultiInput.func1({{0x35b9ad36, 0xee204aec5, 0x0}, 0xbdb2d100360, 0xbdb2d1002d0, {0xc0b340, 0xbdb2d1160c0}, 0x0})
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1785902732031005433/elastic/beats-xpack-filebeat/x-pack/filebeat/input/cometd/input_test.go:259 +0x45
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.mockedOutleter.OnEvent(...)
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1785902732031005433/elastic/beats-xpack-filebeat/x-pack/filebeat/input/cometd/client_mocked.go:46
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.(*cometdInput).run(0xbdb2ced86e0)
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1785902732031005433/elastic/beats-xpack-filebeat/x-pack/filebeat/input/cometd/input.go:128 +0x6b2
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.(*cometdInput).Run.func1.1()
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1785902732031005433/elastic/beats-xpack-filebeat/x-pack/filebeat/input/cometd/input.go:65 +0x413
created by github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.(*cometdInput).Run.func1 in goroutine 79
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1785902732031005433/elastic/beats-xpack-filebeat/x-pack/filebeat/input/cometd/input.go:41 +0x93

```

Contributor guide

Open the contributing guide

Research direction

Start by running TestNegativeCases in x-pack/filebeat/input/cometd and inspect the failure in TestMultiInput at input_test.go:259. Read client_mocked.go:46 and input.go:65, 128 to trace the channel lifecycle. Done means the test can be repeated without a “send on closed channel” panic and the relevant test suite passes.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.