JDK-8321275 : java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java fails with jtreg timeout
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.stream
  • Affected Version: 22,23
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86_64
  • Submitted: 2023-12-04
  • Updated: 2024-09-06
  • Resolved: 2024-09-06
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.
Other
tbdResolved
Related Reports
Duplicate :  
Description

log extract

...

test org.openjdk.tests.java.util.stream.CollectorsTest.testSimpleToMap("array:0..1000", RefTestData[array:0..1000]): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@476f2d0): success
config java.util.stream.LoggingTestCase.before(): success
test org.openjdk.tests.java.util.stream.CollectorsTest.testSimpleToMap("ArrayList.asList:0..1000", java.util.stream.TestData$AbstractTestData$RefTestData@48b052e3): success
config java.util.stream.LoggingTestCase.after(org.testng.internal.TestResult@55798ee4): success
config java.util.stream.LoggingTestCase.before(): success
Timeout signalled after 480 seconds


seems to be stuck in  testSimpleToMap



   void exerciseMapCollection(TestData<T, Stream<T>> data,
                               Collector<T, ?, ? extends M> collector,
                               CollectorAssertion<T, M> assertion)
            throws ReflectiveOperationException {
        boolean ordered = !collector.characteristics().contains(Collector.Characteristics.UNORDERED);

        M m = withData(data)
                .terminal(s -> s.collect(collector))
                .resultAsserter(mapTabulationAsserter(ordered))
                .exercise();

as per main thread stack trace

"MainThread" #35 [19012] prio=5 os_prio=0 cpu=4063406.25ms elapsed=4103.64s allocated=767M defined_classes=1363 tid=0x0000020c0732f690 nid=19012 runnable  [0x00000096032fc000]
   java.lang.Thread.State: RUNNABLE
	at java.util.concurrent.ForkJoinPool.helpComplete(java.base@22-ea/ForkJoinPool.java:2355)
	at java.util.concurrent.ForkJoinTask.awaitDone(java.base@22-ea/ForkJoinTask.java:493)
	at java.util.concurrent.ForkJoinTask.join(java.base@22-ea/ForkJoinTask.java:662)
	at java.util.concurrent.ForkJoinTask.invoke(java.base@22-ea/ForkJoinTask.java:677)
	at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(java.base@22-ea/ForEachOps.java:160)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(java.base@22-ea/ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(java.base@22-ea/AbstractPipeline.java:225)
	at java.util.stream.ReferencePipeline.forEach(java.base@22-ea/ReferencePipeline.java:596)
	at java.util.stream.ReferencePipeline$Head.forEach(java.base@22-ea/ReferencePipeline.java:765)
	at java.util.stream.ReferencePipeline.collect(java.base@22-ea/ReferencePipeline.java:679)
	at org.openjdk.tests.java.util.stream.CollectorsTest.lambda$exerciseMapCollection$1(CollectorsTest.java:332)
	at org.openjdk.tests.java.util.stream.CollectorsTest$$Lambda/0x000000003b154fb8.apply(Unknown Source)
	at java.util.stream.OpTestCase$BaseTerminalTestScenario.run(java.base@22-ea/OpTestCase.java:459)
	at java.util.stream.OpTestCase$ExerciseDataTerminalBuilder.exercise(java.base@22-ea/OpTestCase.java:589)
	at org.openjdk.tests.java.util.stream.CollectorsTest.exerciseMapCollection(CollectorsTest.java:334)
	at org.openjdk.tests.java.util.stream.CollectorsTest.testSimpleToMap(CollectorsTest.java:521)
Comments
Re-closed as Duplicate of JDK-8322732
06-09-2024

fixed in https://bugs.openjdk.org/browse/JDK-8322732
05-06-2024

[~dl] Successful 10k repeats of this test on the failing platform, so I think we can close this as solved by https://bugs.openjdk.org/browse/JDK-8322732
05-06-2024

[~dl] I'm submitting a 10k run for this specific test on the platform which had the problem using the newest FJP. If this comes back clean I think we can call this fixed by the latest FJP.
05-06-2024

I think so too. Needs confirmation.
05-06-2024

[~dl] I suspect this may be fixed by https://bugs.openjdk.org/browse/JDK-8322732 as well.
05-06-2024

The problematic invocations are: exerciseMapCollection(data, toConcurrentMap(keyFn, valueFn, sum), new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class)); exerciseMapCollection(data, toConcurrentMap(keyFn, valueFn, sum, ConcurrentSkipListMap::new), new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentSkipListMap.class)); Under parallel Stream evaluation, which means when using CountedCompleters. Further investigation is needed.
11-01-2024

[~dl] I wonder whether there might be a small/tiny window of opportunity where CountedCompleters are involved where submitting thread ends up being in helpComplete but never terminating. Let's discuss.
03-01-2024

[~dl] Hmmm, could this be related to the recent changes to ForkJoin?
12-12-2023