Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936535 - dev-java/stringtemplate-4.3.4 fails tests with jdk:24
Summary: dev-java/stringtemplate-4.3.4 fails tests with jdk:24
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Java team
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks: jdk24
  Show dependency tree
 
Reported: 2024-07-23 07:19 UTC by Agostino Sarubbo
Modified: 2024-07-26 09:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,141.02 KB, text/plain)
2024-07-23 07:19 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-07-23 07:19:53 UTC
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
Comment 1 Agostino Sarubbo gentoo-dev 2024-07-23 07:19:54 UTC
Created attachment 898181 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-07-23 07:19:55 UTC
Error(s) that match a know pattern:


FAILURES!!!
Comment 3 Volkmar W. Pogatzki 2024-07-23 17:07:32 UTC
Tests pass with openjdk-bin:24
Comment 4 Miroslav Šulc gentoo-dev 2024-07-23 18:07:38 UTC
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.
Comment 5 Volkmar W. Pogatzki 2024-07-23 18:14:32 UTC
(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?
Comment 6 Miroslav Šulc gentoo-dev 2024-07-23 18:34:30 UTC
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"));
Comment 7 Volkmar W. Pogatzki 2024-07-26 04:54:57 UTC
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
Comment 8 Miroslav Šulc gentoo-dev 2024-07-26 08:00:36 UTC
(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?
Comment 9 Larry the Git Cow gentoo-dev 2024-07-26 09:34:21 UTC
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(-)