RFR: 8362087: Test containers/docker/ShareTmpDir.java intermittent fails [v6]

Severin Gehwolf sgehwolf at openjdk.org
Fri Dec 19 17:27:59 UTC 2025


On Wed, 26 Nov 2025 02:27:48 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hi all,
>> 
>> The test containers/docker/ShareTmpDir.java intermittent fails, because before this PR, test assume start two java process in docker container by two threads will make the two java process start simultancely, but in fact, the second java process maybe start slower than the first one, even that the first java process already exit and then the second java process not start yet. If we add `Thread.sleep(2000)` to the second thread at the begin of run() method, will make this intermittent failure to always reproduceable. This prove the anasyis.
>> 
>> If the two java process can not start simultancely, the expected '/tmp/hsperfdata_1 locked' error can not observed. So this test will intermittent fails.
>> 
>> This PR will check all the two java processes started already and runing simultancely before exit, this will make the expected '/tmp/hsperfdata_1 locked' error can be alway observed.
>> 
>> The touch file test/hotspot/jtreg/containers/docker/WaitForFlagFile.java only use for test containers/docker/ShareTmpDir.java.
>> 
>> Change has been verified locally, test-fix only, no risk.
>
> SendaoYan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into jbs8362087
>  - Merge branch 'openjdk:master' into jbs8362087
>  - Merge branch 'openjdk:master' into jbs8362087
>  - Merge branch 'openjdk:master' into jbs8362087
>  - Add synchronized lock for addClassOptions
>  - 8362087: Test containers/docker/ShareTmpDir.java intermittent fails

OK. One tiny nit.

test/hotspot/jtreg/containers/docker/ShareTmpDir.java line 106:

> 104: 
> 105:         while (!started1.exists() || !started2.exists()) {
> 106:             System.out.println("Waiting for all the two JVM started");

Suggestion:

            System.out.println("Waiting for all two JVMs to start");

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

Marked as reviewed by sgehwolf (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26605#pullrequestreview-3599421093
PR Review Comment: https://git.openjdk.org/jdk/pull/26605#discussion_r2635771175


More information about the hotspot-runtime-dev mailing list