GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Reduce flakiness of StatsdMeterRegistryPublishTest by shakuzen · Pull Request #7053 · micrometer-metrics/micrometer Conversation
|
|
It looks completely reasonable to me too but the build on CI seems to have a bad time. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (protocol == StatsdProtocol.TCP || protocol == StatsdProtocol.UDS_DATAGRAM) { | ||
| await().until(() -> meterRegistry.statsdConnection.get() != firstClient); | ||
| } | ||
| await().until(() -> meterRegistry.statsdConnection.get() != firstClient); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I guess we can check the OS/protocol combinations and do this conditionally or maybe we can say that sometimes the client will not be replaced:
| await().until(() -> meterRegistry.statsdConnection.get() != firstClient); | |
| try { | |
| await().until(() -> meterRegistry.statsdConnection.get() != firstClient); | |
| } | |
| catch (ConditionTimeoutException ex) { | |
| // Intentionally ignored: in some cases the client gets replaced | |
| // and in some cases it does not (os and protocol dependent) | |
| // Hope Awaitility will have support for this use-case: | |
| // https://github.com/awaitility/awaitility/issues/48 | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| CountDownLatch server2Latch = new CountDownLatch(3); | ||
| server = startServer(protocol, port, server2Latch); | ||
| if (protocol == StatsdProtocol.TCP || protocol == StatsdProtocol.UDS_DATAGRAM) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should we change this too?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actually, I reverted the previous changes to the other conditional. I think this is right. The client is not replaced for UDP because of the following code and Violeta's fix in Netty to consistently throw PortUnreachableException with UDP on all platforms.
Line 254 in bcbf4fe
| .retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof PortUnreachableException))) |
@violetagg let me know if I'm mistaken.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Let's wait for netty/netty#16131 which should hopefully make this more uniform across platforms. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's not clear why this await behavior was not applied in the case of UDP protocol, but removing the conditional that excludes that seems to fix flakiness of this test.
bc31fdd to
e4db16b
Compare
|
|
||
| CountDownLatch serverLatch = new CountDownLatch(1); | ||
| DisposableChannel server = startServer(StatsdProtocol.UDP, config.port(), serverLatch); | ||
| DisposableChannel server = startServer(StatsdProtocol.UDP, 0, serverLatch); |
There was a problem 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.
There was an error while loading. Please reload this page.
|
I've rebased to pick up the Netty upgrade including the changes from the linked pull request. I reverted the change to the conditional and now things pass (seemingly) consistently locally and on CI. I reworked the pull request to update some places we were using a fixed port instead of getting an available port, which caused some failures running locally. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.