Skip to content

[Heartbeat] Test that omitted default fields fall back to defaults#52233

Draft
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:synthetics/heartbeat-omit-defaults-test
Draft

[Heartbeat] Test that omitted default fields fall back to defaults#52233
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:synthetics/heartbeat-omit-defaults-test

Conversation

@shahzad31

Copy link
Copy Markdown
Contributor

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:

  • http: check.request.method, max_redirects, response.include_body, response.include_headers, ipv4, ipv6, mode, timeout
  • tcp: timeout, ipv4, ipv6, mode, proxy_use_local_resolver
  • icmp: timeout, wait, ipv4, ipv6, mode

Why

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 TestOmittedDefaultsFallBackToHeartbeatDefaults passes

Made with Cursor

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>
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 23, 2026
@botelastic

botelastic Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

@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!)
  • /test : Run the Buildkite pipeline.

@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @shahzad31? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

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