Modify

Opened 13 months ago

Closed 13 months ago

Last modified 4 months ago

#19888 closed defect (fixed)

JosmDecimalFormatSymbolsProviderTest broken on GitHub CI

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 20.11
Component: Unit tests Version:
Keywords: github-ci Cc: Stereo

Description

The unit test JosmDecimalFormatSymbolsProviderTest.testGroupingSeparator introduced via #19397 is not working on GitHub CI: ​https://github.com/openstreetmap/josm/runs/1216949683

Attachments (0)

Change History (12)

comment:1 Changed 13 months ago by simon04

Testing locally:

$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10)
OpenJDK 64-Bit Server VM (build 11.0.8+10, mixed mode)

$ cat /etc/locale.conf
de_AT.UTF-8 UTF-8
en_GB.UTF-8 UTF-8 
en_IE.UTF-8 UTF-8 
en_US.UTF-8 UTF-8

$ LANG=en_AU.UTF-8 ant test '-Ddefault-junit-includes=**/JosmDecimalFormatSymbolsProviderTest.class'
# OK (0 tests failed)

$ LANG=en_GB.UTF-8 ant test '-Ddefault-junit-includes=**/JosmDecimalFormatSymbolsProviderTest.class'
# BROKEN (1 tests failed)

$ LANG=en_IE.UTF-8 ant test '-Ddefault-junit-includes=**/JosmDecimalFormatSymbolsProviderTest.class'
# BROKEN (1 tests failed)

$ LANG=en_US.UTF-8 ant test '-Ddefault-junit-includes=**/JosmDecimalFormatSymbolsProviderTest.class'
# OK (0 tests failed)

What's going on?

comment:2 Changed 13 months ago by simon04

In 17089/josm:

see #19888 - Make PluginHandlerJOSMTooOldTest more robust

comment:3 Changed 13 months ago by simon04

Ticket #19443 has been marked as a duplicate of this ticket.

comment:4 Changed 13 months ago by simon04

Cc: Stereo added

comment:5 Changed 13 months ago by simon04

In 17155/josm:

see #19888, see #19370 - GitHub Actions: specify LANG=en_US.UTF-8

comment:6 Changed 13 months ago by Stereo

I didn't know anyone was actually using these on the JOSM side! I've been vaguely maintaining a fork at https://github.com/thomersch/josm/

Tests get broken about once a month for one reason or another, and it's a bit frustrating. I think it would be more useful and transparent if we could repatriate the infrastructure to build the macOS releases on Github on the 'main' repo.

comment:7 Changed 13 months ago by simon04

Resolution: fixed
Status: assignedclosed

The unit test failure is gone thanks to r17155.

comment:8 Changed 13 months ago by simon04

@Stereo, for the general GitHub CI discussion, please use #19370.

comment:9 Changed 11 months ago by Don-vip

Milestone: 20.1020.11

Milestone renamed

comment:10 Changed 4 months ago by Don-vip

@Simon I still see this error on GitHub. And I can reproduce locally on Windows 10 French, from Eclipse and Java 16:

org.opentest4j.AssertionFailedError: de ==> expected: <123 456> but was: <123.456>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1135)
	at org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProviderTest.checkGroupingSymbol(JosmDecimalFormatSymbolsProviderTest.java:42)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1694)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProviderTest.testGroupingSeparator(JosmDecimalFormatSymbolsProviderTest.java:36)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
...
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:84)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

comment:11 Changed 4 months ago by Don-vip

In my case our provider is completely ignored and setup very early indirectly by org.junit.platform.engine.UniqueIdFormat:

Thread [main] (Suspended (breakpoint at line 217 in sun.util.locale.provider.JRELocaleProviderAdapter))	
	sun.util.cldr.CLDRLocaleProviderAdapter(sun.util.locale.provider.JRELocaleProviderAdapter).getDecimalFormatSymbolsProvider() line: 217	
	sun.util.cldr.CLDRLocaleProviderAdapter(sun.util.locale.provider.JRELocaleProviderAdapter).getLocaleServiceProvider(java.lang.Class<P>) line: 101	
	sun.util.locale.provider.LocaleProviderAdapter.findAdapter(java.lang.Class<? extends java.util.spi.LocaleServiceProvider>, java.util.Locale) line: 289	
	sun.util.locale.provider.LocaleProviderAdapter.getAdapter(java.lang.Class<? extends java.util.spi.LocaleServiceProvider>, java.util.Locale) line: 258	
	java.text.DecimalFormatSymbols.getInstance(java.util.Locale) line: 180	
	java.util.Formatter.getZero(java.util.Locale) line: 2453	
	java.util.Formatter.<init>(java.util.Locale, java.lang.Appendable) line: 1972	
	java.util.Formatter.<init>() line: 1994	
	java.lang.String.format(java.lang.String, java.lang.Object...) line: 3290	
	org.junit.platform.engine.UniqueIdFormat.<init>(char, char, char, char) line: 74	
	org.junit.platform.engine.UniqueIdFormat.<clinit>() line: 42	
	org.junit.platform.engine.UniqueId.parse(java.lang.String) line: 53	
	org.junit.platform.engine.discovery.DiscoverySelectors.selectUniqueId(java.lang.String) line: 696	
	org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createUniqueIdTest(java.lang.String, java.lang.String[][]) line: 100	
	org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.loadTests(java.lang.Class<?>[], java.lang.String, java.lang.String[], java.lang.String[], java.lang.String[][], java.lang.String, org.eclipse.jdt.internal.junit.runner.RemoteTestRunner) line: 44	
	org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(java.lang.String[], java.lang.String, org.eclipse.jdt.internal.junit.runner.TestExecution) line: 513	
	org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(org.eclipse.jdt.internal.junit.runner.TestExecution) line: 756	
	org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run() line: 452	
	org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(java.lang.String[]) line: 210	

comment:12 Changed 4 months ago by Don-vip

In 17967/josm:

see #19888 - make sure java.locale.providers is set early to SPI,JRE,CLDR for unit tests with Java >= 9 (before JUnit itself initializes Java locales)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.