https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: dev-java/stringtemplate-4.3.4 fails tests. Discovered on: amd64 (internal ref: gcc14_tinderbox) System: GCC-14-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#GCC-14) - openjdk-bin-24 Info about the issue: https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0015
Created attachment 898181 [details] build.log build log and emerge --info
Error(s) that match a know pattern: FAILURES!!!
Tests pass with openjdk-bin:24
There were 4 failures: 1) testRendererForGroup(org.stringtemplate.v4.test.TestRenderers) org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM> but was:<...etime: 7/5/05, 12:00[ ]AM> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.stringtemplate.v4.test.TestRenderers.testRendererForGroup(TestRenderers.java:84) 2) testRendererWithPredefinedFormat2(org.stringtemplate.v4.test.TestRenderers) org.junit.ComparisonFailure: expected:<...uesday, July 5, 2005[ at 12:00:00 ]AM Pacific Daylight ...> but was:<...uesday, July 5, 2005[, 12:00:00 ]AM Pacific Daylight ...> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat2(TestRenderers.java:137) 3) testRendererWithPredefinedFormat4(org.stringtemplate.v4.test.TestRenderers) org.junit.ComparisonFailure: expected:< time: 12:00:00[ ]AM > but was:< time: 12:00:00[ ]AM > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat4(TestRenderers.java:173) 4) testRendererWithPredefinedFormat(org.stringtemplate.v4.test.TestRenderers) org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM > but was:<...etime: 7/5/05, 12:00[ ]AM > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat(TestRenderers.java:115) this might in fact be caused by different locales used for the tests. the tests seem to require specific locale being used.
(In reply to Volkmar W. Pogatzki from comment #3) > Tests pass with openjdk-bin:24 Sorry for confusion. wants to say "openjdk-bin:21" (In reply to Miroslav Šulc from comment #4) > There were 4 failures: > 1) testRendererForGroup(org.stringtemplate.v4.test.TestRenderers) > org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM> but > was:<...etime: 7/5/05, 12:00[ ]AM> > at org.junit.Assert.assertEquals(Assert.java:117) > at org.junit.Assert.assertEquals(Assert.java:146) > at > org.stringtemplate.v4.test.TestRenderers.testRendererForGroup(TestRenderers. > java:84) > 2) > testRendererWithPredefinedFormat2(org.stringtemplate.v4.test.TestRenderers) > org.junit.ComparisonFailure: expected:<...uesday, July 5, 2005[ at 12:00:00 > ]AM Pacific Daylight ...> but was:<...uesday, July 5, 2005[, 12:00:00 ]AM > Pacific Daylight ...> > at org.junit.Assert.assertEquals(Assert.java:117) > at org.junit.Assert.assertEquals(Assert.java:146) > at > org.stringtemplate.v4.test.TestRenderers. > testRendererWithPredefinedFormat2(TestRenderers.java:137) > 3) > testRendererWithPredefinedFormat4(org.stringtemplate.v4.test.TestRenderers) > org.junit.ComparisonFailure: expected:< time: 12:00:00[ ]AM > but was:< > time: 12:00:00[ ]AM > > at org.junit.Assert.assertEquals(Assert.java:117) > at org.junit.Assert.assertEquals(Assert.java:146) > at > org.stringtemplate.v4.test.TestRenderers. > testRendererWithPredefinedFormat4(TestRenderers.java:173) > 4) testRendererWithPredefinedFormat(org.stringtemplate.v4.test.TestRenderers) > org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM > but > was:<...etime: 7/5/05, 12:00[ ]AM > > at org.junit.Assert.assertEquals(Assert.java:117) > at org.junit.Assert.assertEquals(Assert.java:146) > at > org.stringtemplate.v4.test.TestRenderers. > testRendererWithPredefinedFormat(TestRenderers.java:115) > > > > this might in fact be caused by different locales used for the tests. the > tests seem to require specific locale being used. If tests pass with openjdk-bin:21 but fail with openjdk-bin:24, does that mean jdk has changed locales?
well, i ran the tests on my system now and it seems the locale is hardcoded somewhere. so the real reason really is that the generated strings are different in 24 than in 21. specifically, in the 4 failures, three times different space is used in the strings, and one case has the space changed and also a comma is used instead of "at". to skip the tests when java 24 is used, we can add to the beginning of the failing functions something like this: org.junit.Assume.assumeFalse(System.getProperty("java.version").startsWith("24"));
There was the same problem with Java 21 solved with [1]. The patch has 3 lines with: else if ( javaVersion.startsWith("21") ) [1]https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch?id=7accbac256b52711f5f70597ffcb0777b848ad57
(In reply to Volkmar W. Pogatzki from comment #7) > There was the same problem with Java 21 solved with [1]. The patch has 3 > lines with: > > else if ( javaVersion.startsWith("21") ) > > [1]https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-java/stringtemplate/ > files/stringtemplate-4.3.4-Java21-TestRenderers. > patch?id=7accbac256b52711f5f70597ffcb0777b848ad57 ah, i didn't check. well, do you think you can update the patch or i should do it?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fc319802f811bfc774024d7cf46d3a6815aabde commit 8fc319802f811bfc774024d7cf46d3a6815aabde Author: Miroslav Šulc <fordfrog@gentoo.org> AuthorDate: 2024-07-26 09:33:47 +0000 Commit: Miroslav Šulc <fordfrog@gentoo.org> CommitDate: 2024-07-26 09:33:47 +0000 dev-java/stringtemplate: fixed tests in java 21+ for 4.3.4 + simplified applying the patch Closes: https://bugs.gentoo.org/936535 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org> ...rs.patch => stringtemplate-4.3.4-Java21+-TestRenderers.patch} | 8 ++++---- dev-java/stringtemplate/stringtemplate-4.3.4.ebuild | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-)