Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #18797 to 7.8: Fix panic on metricbeat test modules #18852

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

jsoriano
Copy link
Member

Cherry-pick of PR #18797 to 7.8 branch. Original message:

What does this PR do?

Fix panic on `metricbeat test modules`

Since metricbeat light modules support processors (#15923), module
initialization requires a publisher in the beat so modules can attach
their processors. `metricbeat test modules` is not initializing as
normal metricbeat commands, and it is not initializing any output or
publisher pipeline, so metricbeat panics when trying to initialize
modules with the new method.

This change adds a dummy publisher for this case, and fixes also a
condition that was adding a `nil` module option, causing additional
panics. A test that reproduced the issue is also added.

Why is it important?

metricbeat test modules is not working with modules defined in the main configuration file.

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
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 29, 2020
Since metricbeat light modules support processors (elastic#15923), module
initialization requires a publisher in the beat so modules can attach
their processors. `metricbeat test modules` is not initializing as
normal metricbeat commands, and it is not initializing any output or
publisher pipeline, so metricbeat panics when trying to initialize
modules with the new method.

This change adds a dummy publisher for this case, and fixes also a
condition that was adding a `nil` module option, causing additional
panics. A test that reproduced the issues is also added.

(cherry picked from commit 25b8bf1)
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 29, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #18852 updated]

  • Start Time: 2020-06-03T13:47:33.714+0000

  • Duration: 83 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 2833
Skipped 615
Total 3448

@andresrc andresrc added the Team:Integrations Label for the Integrations team label Jun 1, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 1, 2020
@ChrsMark
Copy link
Member

ChrsMark commented Jun 1, 2020

ah, it seems there is a conflict in changelog @jsoriano ?

@jsoriano jsoriano requested a review from ChrsMark June 2, 2020 11:15
@jsoriano jsoriano merged commit e984e2f into elastic:7.8 Jun 3, 2020
@jsoriano jsoriano deleted the backport_18797_7.8 branch June 3, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants