Skip to content

Conversation

@orestisfl
Copy link
Contributor

Proposed commit message

This is a manually resolved backport of #47969 to the 8.19 branch. The original automatic backport (#47994) had merge conflicts.

Changes:

  • Refactor TestMultipleReceivers to easily scale to n>2 receivers
  • Clean up *.sock files
  • Add multiReceiverHelper struct to encapsulate receiver test setup
  • Add helper functions: hostFromSocket, writeFile
  • Use UUID for socket path generation instead of random bytes
  • Use DialContext instead of Dial to fix noctx lint warning

Conflict Resolution:

The conflict was in x-pack/filebeat/fbreceiver/receiver_test.go. The 8.19 branch had updated assertions to check agent.otelcol.component.id and agent.otelcol.component.kind fields instead of message. The resolution:

  • Kept the refactored loop style from fbreceiver: refactor receiver tests for maintainability #47969 (iterating over helpers)
  • Adapted the 8.19-specific assertions to use the new helper pattern:
    assert.Equalf(c, "filebeatreceiver/"+helper.name, logs[helper.name][0].Flatten()["agent.otelcol.component.id"], ...)
    assert.Equalf(c, "receiver", logs[helper.name][0].Flatten()["agent.otelcol.component.kind"], ...)

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

How to test this PR locally

Run the test:

cd x-pack/filebeat/fbreceiver
go test -v -count=1 -run "TestMultipleReceivers|TestNewReceiver|TestLeak" ./...

Related issues

Changes:
- Refactor TestMultipleReceivers to easily scale to n>2 receivers
- Clean up *.sock files
- Add multiReceiverHelper struct to encapsulate receiver test setup
- Add helper functions: hostFromSocket, writeFile
- Use UUID for socket path generation instead of random bytes
- Use DialContext instead of Dial to fix noctx lint warning

Pulled out from elastic#47870 for easier review.
@orestisfl orestisfl requested a review from a team as a code owner December 9, 2025 14:39
@orestisfl orestisfl requested review from belimawr and mauri870 and removed request for a team December 9, 2025 14:39
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 9, 2025
@botelastic
Copy link

botelastic bot commented Dec 9, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

🤖 GitHub comments

Just comment with:

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

@orestisfl orestisfl closed this Dec 9, 2025
@orestisfl orestisfl deleted the backport-47969-8.19 branch December 9, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant