[Heartbeat] Test that omitted default fields fall back to defaults#52233
Draft
shahzad31 wants to merge 1 commit into
Draft
[Heartbeat] Test that omitted default fields fall back to defaults#52233shahzad31 wants to merge 1 commit into
shahzad31 wants to merge 1 commit into
Conversation
Add unit tests for the http, tcp and icmp active monitors proving that when a configuration field is either fully absent or explicitly null, Heartbeat still applies the exact same default value, and that explicit non-default values still override. This is the safety proof for the Kibana/integrations change that stops emitting monitor fields whose value already equals the Heartbeat default (elastic/kibana#241818, elastic/integrations#20342). Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request doesn't have a |
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds unit tests for the http, tcp and icmp active monitors proving that when a configuration field is either fully absent or explicitly
null, Heartbeat still applies the exact same default value — and that explicit non-default values still override.Fields covered:
check.request.method,max_redirects,response.include_body,response.include_headers,ipv4,ipv6,mode,timeouttimeout,ipv4,ipv6,mode,proxy_use_local_resolvertimeout,wait,ipv4,ipv6,modeWhy
This is the safety proof for a change in Kibana + the Synthetics integration that stops emitting monitor fields whose value already equals the Heartbeat default (to shrink the agent payload):
These tests guarantee that dropping such fields from the agent stream is behavior-neutral for the running monitor.
Test plan
go test ./heartbeat/monitors/active/{http,tcp,icmp}/ -run TestOmittedDefaultsFallBackToHeartbeatDefaultspassesMade with Cursor