Skip to content
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.

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

Fix flakiness in JettyClientMetricsWithObservationTest.activeTimer() #5894

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

izeye
Copy link
Contributor

@izeye izeye commented Feb 5, 2025

I saw the following failure locally:

JettyClientMetricsWithObservationTest > activeTimer(WireMockRuntimeInfo) FAILED
    org.opentest4j.AssertionFailedError:
    expected: 1
     but was: 0
        at java.base@17.0.14/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base@17.0.14/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base@17.0.14/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base@17.0.14/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at app//io.micrometer.jetty12.client.JettyClientMetricsWithObservationTest.activeTimer(JettyClientMetricsWithObservationTest.java:56)

It could be reproducible with @RepeatedTest(100) locally, and the Develocity Build Scan also flags it as a flaky one.

Looking into its code, there seems to be a race condition, but I couldn't find a clean way to fix it.

This PR attempts to fix its flakiness even though it's still relying on timing.

Signed-off-by: Johnny Lim <izeye@naver.com>
@shakuzen shakuzen added this to the 1.13.11 milestone Feb 6, 2025
@shakuzen shakuzen added the type: task A general task label Feb 6, 2025
@shakuzen shakuzen merged commit 20d0a9e into micrometer-metrics:1.13.x Feb 6, 2025
8 checks passed
@izeye izeye deleted the fix-flakiness branch February 6, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants