Skip to content

Fix StatsdMeterRegistry client readiness check in tests - #7874

Merged
shakuzen merged 1 commit into
micrometer-metrics:1.17.xfrom
shakuzen:fix/statsd-test-client-readiness-1.17.x
Aug 24, 2026
Merged

shakuzen merged 1 commit into
micrometer-metrics:1.17.xfrom
shakuzen:fix/statsd-test-client-readiness-1.17.x

Conversation

@shakuzen

@shakuzen shakuzen commented Aug 24, 2026 •

Copy link
Copy Markdown
Member
  • Fixes a flaky test race condition in TelegrafStatsdLineBuilderIntegrationTest where checking !isDisposed() on an uninitialized (null) connection immediately returned true, causing metrics to be emitted and the registry closed before the background connection was established.
  • Aligns test helpers across TelegrafStatsdLineBuilderIntegrationTest and StatsdMeterRegistryPublishTest to check readiness positively (isClientReady), ensuring the connection is both non-null and not disposed.

When checking if the StatsdMeterRegistry client is ready before
emitting metrics in tests, the connection swap starts as null while
the background connection is being established.

Checking `!isDisposed()` on a null connection incorrectly evaluated to
ready immediately in `TelegrafStatsdLineBuilderIntegrationTest`, causing
metrics to be dropped and leading to flaky test failures.

This updates the test helpers to check readiness positively (`isClientReady`),
verifying that the connection is both non-null and not disposed.
@shakuzen shakuzen added type: task A general task registry: statsd A StatsD Registry related issue labels Aug 24, 2026
@shakuzen shakuzen added this to the 1.17.2 milestone Aug 24, 2026
@shakuzen
shakuzen enabled auto-merge (squash) August 24, 2026 01:27
@shakuzen
shakuzen merged commit 0fc2025 into micrometer-metrics:1.17.x Aug 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

registry: statsd A StatsD Registry related issue type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant