JDK-8327854 : Test java/util/stream/test/org/openjdk/tests/java/util/stream/WhileOpStatefulTest.java failed with RuntimeException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.stream
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-03-11
  • Updated: 2024-07-04
  • Resolved: 2024-06-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23 JDK 24
23Unresolved 24 b05Fixed
Related Reports
Relates :  
Description
A very unhelpful exception:

----------System.out:(77/6065)----------
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testCountDropWithCount(): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@65887f99): success
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testCountDropWithToArray(): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@4b4d280): success
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testCountTakeWithCount(): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@735edf02): success
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testCountTakeWithToArray(): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@2c5ec211): success
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testTimedTakeWithCount(): failure
java.lang.RuntimeException
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.lambda$testWhileMulti$64(WhileOpStatefulTest.java:269)
	at java.base/java.util.stream.ReferencePipeline$15$1.accept(ReferencePipeline.java:555)
	at java.base/java.util.stream.StreamSpliterators$InfiniteSupplyingSpliterator$OfRef.tryAdvance(StreamSpliterators.java:1367)
	at java.base/java.util.stream.StreamSpliterators$DoubleWrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:461)
	at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
	at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:169)
	at java.base/java.util.stream.StreamSpliterators$DoubleWrappingSpliterator.tryAdvance(StreamSpliterators.java:472)
	at java.base/java.util.stream.WhileOps$UnorderedWhileSpliterator$OfDouble$Taking.tryAdvance(WhileOps.java:1063)
	at java.base/java.util.Spliterator$OfDouble.forEachRemaining(Spliterator.java:803)
	at java.base/java.util.Spliterator$OfDouble.forEachRemaining(Spliterator.java:843)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
	at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:960)
	at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:934)
	at java.base/java.util.stream.AbstractTask.compute(AbstractTask.java:327)
	at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:759)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:676)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:927)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:264)
	at java.base/java.util.stream.LongPipeline.reduce(LongPipeline.java:498)
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.lambda$testTimedTakeWithCount$11(WhileOpStatefulTest.java:86)
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.lambda$testWhileMulti$78(WhileOpStatefulTest.java:282)
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testWhileMulti(WhileOpStatefulTest.java:295)
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testTakeWhileMulti(WhileOpStatefulTest.java:224)
	at org.openjdk.tests.java.util.stream.WhileOpStatefulTest.testTimedTakeWithCount(WhileOpStatefulTest.java:63)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
	at org.testng.TestRunner.privateRun(TestRunner.java:764)
	at org.testng.TestRunner.run(TestRunner.java:585)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
	at org.testng.TestNG.runSuites(TestNG.java:1069)
	at org.testng.TestNG.run(TestNG.java:1037)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:102)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:58)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1575)
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@46d2da4c): success
Comments
Changeset: 27982c8f Author: Viktor Klang <vklang@openjdk.org> Date: 2024-07-02 20:27:52 +0000 URL: https://git.openjdk.org/jdk/commit/27982c8f5dad0e2d080846f803055c84bac9fddd
02-07-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19131 Date: 2024-05-07 22:50:18 +0000
05-06-2024

Changeset: 789f704d Author: Doug Lea <dl@openjdk.org> Date: 2024-06-05 13:02:15 +0000 URL: https://git.openjdk.org/jdk/commit/789f704d9ab5aaf87193f508859c4c9a528d7779
05-06-2024

[~dl] I'm running a 10k repeat stress of this test on the failing architecture under the changes in JDK-8322732 right now.
04-06-2024

Can someone stress-test this under https://bugs.openjdk.org/browse/JDK-8322732 so we can add it as /issue there?
04-06-2024

[~dl] I suspect this one will be fixed by the fix to https://bugs.openjdk.org/browse/JDK-8322732
04-06-2024

Likely addressed by the improvements / fixes related to this issue
03-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19508 Date: 2024-06-01 11:49:39 +0000
01-06-2024

I have a suspicion that this issue might be solved by https://github.com/openjdk/jdk/pull/19131 I'll submit a separate PR to improve the error messages for this specific test case.
01-06-2024

A part of the fix, if any, will be to add some sensible descriptions to those RuntimeExceptions.
12-03-2024

Looks like a timeout: 263: transforms.put("Stream.parallel()", s -> { 264: BooleanSupplier isWithinExecutionPeriod = within(System.currentTimeMillis(), 265: EXECUTION_TIME_LIMIT); 266: return s.parallel() 267: .peek(e -> { 268: if (!isWithinExecutionPeriod.getAsBoolean()) { 269: throw new RuntimeException(); 270: } 271: }); 272: });
11-03-2024