RFR: 8359827: Test runtime/Thread/ThreadCountLimit.java should run exclusively [v6]

SendaoYan syan at openjdk.org
Tue Jul 22 12:18:26 UTC 2025


> Hi all,
> 
> The test runtime/Thread/ThreadCountLimit.java was observed fails when run with other tests. The test start subprocess with [shell prefix command](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java#L82) `ulimit -u 4096` which intend to limite the usage of thread number. But this will cause test fails when this test run with other tests. I create a demo to demonstrate that.
> 
> I start a java process which will create 5k threads, and then I can not start new java process with prefix `ulimit -u 4096` on the same machine.
> 
> <img width="1573" height="182" alt="image" src="https://github.com/user-attachments/assets/8dd53ade-cad7-4a2f-b5d9-d4b2d200b728" />
> 
> 
> [ManyThreads.java.txt](https://github.com/user-attachments/files/21324354/ManyThreads.java.txt)
> 
> So it's necessary to make this test run sperately to make this test success.
> Change has been verified locally, test-fix only, risk is low.

SendaoYan has updated the pull request incrementally with two additional commits since the last revision:

 - Revert "Use 'docker run --pids-limit 4096' to instead the original 'ulimit -u 4096'"
   
   This reverts commit f993419b20b5dd2273a4f6c3c54e79fb8f955383.
 - Revert "Remove extra whitespaces"
   
   This reverts commit 374c297b52b03e8b471465010f99b1b6bc3174f0.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26401/files
  - new: https://git.openjdk.org/jdk/pull/26401/files/374c297b..77884c21

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26401&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26401&range=04-05

  Stats: 327 lines in 4 files changed: 150 ins; 176 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/26401.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26401/head:pull/26401

PR: https://git.openjdk.org/jdk/pull/26401


More information about the hotspot-runtime-dev mailing list