Skip to content

[8.19](backport #48785) Fix Kafka flaky tests#49140

Merged
rdner merged 1 commit into8.19from
mergify/bp/8.19/pr-48785
Feb 26, 2026
Merged

[8.19](backport #48785) Fix Kafka flaky tests#49140
rdner merged 1 commit into8.19from
mergify/bp/8.19/pr-48785

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Feb 26, 2026

Proposed commit message

  • Added delays and waits at certain steps to ensure the Kafka configuration running properly before starting the test.
  • Add connection retries for the Kafka producer

Assisted by Cursor.

The Kafka tests are flaky and sometime fails with:

=== FAIL: filebeat/input/kafka TestSASLAuthentication/PLAIN (0.93s)
kafka_integration_test.go:369: kafka server: In the middle of a leadership election, there is currently no leader for this partition and hence it is unavailable for writes

For example, in this build https://buildkite.com/elastic/filebeat/builds/28161#019c482f-481b-40db-85e6-34da7056207f

Relates to #48026


This is an automatic backport of pull request #48785 done by Mergify.

* Added delays and waits at certain steps to ensure the Kafka
configuration running properly before starting the test.
* Add connection retries for the Kafka producer

Assisted by Cursor.

* Try to disable leader election

* Replace the attempts loop with the eventually call

* Make the helper more debuggable

* filebeat/input/kafka: stabilize TestSASLAuthentication topic setup

Create the test topic explicitly and wait for partition leaders before producing messages, preventing transient CI failures with “no leader for this partition” during topic auto-creation.

GenAI-Assisted: Yes
Human-Reviewed: Yes
Tool: Cursor CLI, Model: GPT-5.3 Codex

---------

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
(cherry picked from commit 0132a25)
@mergify mergify bot added the backport label Feb 26, 2026
@mergify mergify bot requested a review from a team as a code owner February 26, 2026 14:03
@mergify mergify bot added the backport label Feb 26, 2026
@mergify mergify bot assigned rdner Feb 26, 2026
@mergify mergify bot requested review from faec and leehinman and removed request for a team February 26, 2026 14:03
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions bot added Filebeat Filebeat flaky-test Unstable or unreliable test cases. Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-changelog labels Feb 26, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 26, 2026
@mergify mergify bot mentioned this pull request Feb 26, 2026
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Feb 26, 2026
@botelastic
Copy link
Copy Markdown

botelastic bot commented Feb 26, 2026

This pull request doesn't have a Team:<team> label.

@rdner rdner requested review from rdner and removed request for faec and leehinman February 26, 2026 14:08
@rdner rdner enabled auto-merge (squash) February 26, 2026 14:12
@rdner rdner merged commit 3936864 into 8.19 Feb 26, 2026
194 checks passed
@rdner rdner deleted the mergify/bp/8.19/pr-48785 branch February 26, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Filebeat Filebeat flaky-test Unstable or unreliable test cases. skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants