8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu.

Backport-of: 6e48caf2507d4a45e1861ee699a32a5e459d70c2
This commit is contained in:
SendaoYan 2025-07-08 08:36:55 +00:00 committed by Severin Gehwolf
parent d0281bedf0
commit 35d219b4d4

View File

@ -120,7 +120,8 @@ public class ConcurrentAssociateTest {
}
};
int ps = Runtime.getRuntime().availableProcessors();
// Bound concurrency to avoid degenerate performance
int ps = Math.min(Runtime.getRuntime().availableProcessors(), 32);
Stream<CompletableFuture> runners = IntStream.range(0, ps)
.mapToObj(i -> sr.get())
.map(CompletableFuture::runAsync);