GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reduce flakiness of StatsdMeterRegistryPublishTest by shakuzen · Pull Request #7053 · micrometer-metrics/micrometer

Reduce flakiness of StatsdMeterRegistryPublishTest #7053

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.

Sign up for GitHub

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

Merged
shakuzen merged 3 commits into micrometer-metrics:1.15.x from shakuzen:flaky-statsd-publish
Feb 9, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Reduce flakiness of StatsdMeterRegistryPublishTest #7053

Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
e4db16b
Improve flakiness of resumeSendingMetrics_whenServerIntermittentlyFails
shakuzen Jan 6, 2026
320cd14
Update tests for fixed netty behavior
shakuzen Feb 9, 2026
402f814
Add back TCP as it sometimes fails otherwise
shakuzen Feb 9, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

16 changes: 8 additions & 8 deletions 16 ...er-registry-statsd/src/test/java/io/micrometer/statsd/StatsdMeterRegistryPublishTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ void receiveParallelMetricsSuccessfully(StatsdProtocol protocol) throws Interrup

@Test
void counterIncrementWorksWithSleepAfterRegistryStart() throws InterruptedException {
StatsdConfig config = StatsdConfig.DEFAULT;

CountDownLatch serverLatch = new CountDownLatch(1);
DisposableChannel server = startServer(StatsdProtocol.UDP, config.port(), serverLatch);
DisposableChannel server = startServer(StatsdProtocol.UDP, 0, serverLatch);
final int port = getPort(server, StatsdProtocol.UDP);

StatsdMeterRegistry registry = new StatsdMeterRegistry(config, Clock.SYSTEM);
StatsdMeterRegistry registry = new StatsdMeterRegistry(getBufferedConfig(StatsdProtocol.UDP, port),
Clock.SYSTEM);
Thread.sleep(1000);

Counter counter = Counter.builder("my.counter").register(registry);
Expand All @@ -351,12 +351,12 @@ void counterIncrementWorksWithSleepAfterRegistryStart() throws InterruptedExcept

@Test
void counterIncrementDoesNotWorkWithoutSleepAfterRegistryStart() throws InterruptedException {
StatsdConfig config = StatsdConfig.DEFAULT;

CountDownLatch serverLatch = new CountDownLatch(1);
DisposableChannel server = startServer(StatsdProtocol.UDP, config.port(), serverLatch);
DisposableChannel server = startServer(StatsdProtocol.UDP, 0, serverLatch);
Comment thread

@shakuzen shakuzen Feb 9, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we were using a fixed port before but it doesn't seem important to the test so I updated this to use a random port which avoids port conflicts (especially when running tests locally).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
final int port = getPort(server, StatsdProtocol.UDP);

StatsdMeterRegistry registry = new StatsdMeterRegistry(config, Clock.SYSTEM);
StatsdMeterRegistry registry = new StatsdMeterRegistry(getBufferedConfig(StatsdProtocol.UDP, port),
Clock.SYSTEM);

Counter counter = Counter.builder("my.counter").register(registry);
counter.increment();
Expand Down
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.