Allocation tests in scala/scala fail on JDK 19
SethTisue opened this issue · 7 comments
reproducible with partest test/files/run/small-seq-apply.scala
(perhaps other tests are affected as well?)
what's weird is that it succeeds again on JDK 20 early-access (20-ea+31-2311)
reported by @AminMal on Discord. @som-snytt was already aware
wide eyes because Seth is like, You need to use a real JDK like 20-ea+31-2311.
LTS stands for Losers That are Scared (to live on the edge)
Love Tormenting Seth with jdk version issues.
I am way behind the curve 21.ea.6-open
.
perhaps other tests are affected as well?
Other partests were fine on java 8 and 11, not sure about other versions.
I was about to certify JDK 20 but the large list test in the junit test just failed, with the loop count boosted to 10K.
The allocation metric falls 336, 296,
by 40 instead of 16. What is size 40? 16 + 3*8.
Apparently, my comment in the partest was:
restored partest (cf junit) to test outside scala.collection package
but the "large" test is commented out, possibly for no particular reason. I remember that the test was for the rewrite in cleanup, which is why the test needed to be compiled in a neutral package, but a junit test could also be assigned an arbitrary package; the other reason to use partest is that it's testing compiler behavior.
I also remember lrytz commenting that it could or ought to be a BytecodeTest or BytecodeTesting. That is, there is a more direct way to check the behavior than measuring for side effects.
Similar result on JDK 21.
[error] Test scala.collection.immutable.ListAllocationTest.largeListAllocation failed: java.lang.AssertionError: allocating min = 592 allowed = 616 -- list size 20
It was hard enough writing 2023, but JDK 21?
closing as "not planned", since small-seq-apply.scala
succeeds on the latest JDK 20 prerelease, and the final release of JDK 20 is expected this month
I'm working on making the test suite pass on JDK 20 at scala/scala#10306 and scala/scala#10335 , and if I hit any allocation failures I'll check Som's notes above