filebeat: stabilize kafka input integration topic readiness#49228
filebeat: stabilize kafka input integration topic readiness#49228
Conversation
Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
/ai create the changelog entry. If you need examples, look at the files in |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughIntroduces a refactored Kafka topic creation pattern for Filebeat integration tests. Replaces the 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
…readiness-tests-16054147cf2deff4
|
CI failure is a golangci-lint timeout on Recommended fix: increase lint timeout in Tests run for this investigation: log inspection only (no local code/tests executed). What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
@Mergifyio backport 8.19 9.2 9.3 |
✅ Backports have been createdDetails
|
Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co> (cherry picked from commit f6a7f39)
Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co> (cherry picked from commit f6a7f39)
Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co> (cherry picked from commit f6a7f39)
…49272) Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- (cherry picked from commit f6a7f39) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…49273) Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- (cherry picked from commit f6a7f39) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…49271) Use a shared helper that creates and waits for a test topic to become writable before producing events. Apply it across kafka integration tests, including TestTest, to reduce leader-election race flakes. GenAI-Assisted: Yes Human-Reviewed: Yes Tool: GitHub Copilot CLI, Model: GPT-5.3 Codex --------- (cherry picked from commit f6a7f39) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Proposed commit message
Summary
createReadyTestTopic(t)to centralize kafka test-topic setup and readiness waitingTestTestand the other topic-writing tests so they all avoid leader-election write races consistentlyWhy
TestTestflake reports show transientno leader for this partitionwrite errors. Other tests in the same file had the same write-on-fresh-topic pattern; this change applies the readiness guard uniformly.Validation
go test -tags=integration ./filebeat/input/kafka -run '^(TestInput|TestInputWithMultipleEvents|TestInputWithJsonPayload|TestInputWithJsonPayloadAndMultipleEvents|TestSASLAuthentication|TestTest)$' -count=1 -vconnect: connection refusedonlocalhost:9094), but the modified code path compiles and executes until environment connection.Fixes [Flaky Test] Kafka TestTest:
kafka server: In the middle of a leadership election, there is currently no leader for this partition and hence it is unavailable for writes#49206What is this? | From workflow: Mention in Issue
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.