Skip to content

Fix failing test when JVM default locale is not US#1359

Merged
jfallows merged 1 commit intoaklivity:developfrom
epieffe:develop
Mar 17, 2025
Merged

Fix failing test when JVM default locale is not US#1359
jfallows merged 1 commit intoaklivity:developfrom
epieffe:develop

Conversation

@epieffe
Copy link
Contributor

@epieffe epieffe commented Dec 24, 2024

Description

The test PrometheusMetricsPrinterTest.shouldWorkWithMilliseconds() fails when the default JVM locale does not use dot (.) as the decimal separator, because floating point numbers are formatted differently and the string comparison does not match.

Solution: explicitly set the locale to Locale.US when formatting decimal numbers. This makes the test pass regardless of the JVM locale settings and generally ensures more consistent behaviour because the output is independent from the JVM local configuration.

@jfallows jfallows merged commit b29fa6d into aklivity:develop Mar 17, 2025
36 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants