RFR for JDK-7195249 Some jtreg tests use hard coded ports

taras ledkov taras.ledkov at oracle.com
Wed Nov 6 06:04:29 PST 2013

Hi Everyone

I am working on bug https://bugs.openjdk.java.net/browse/JDK-7195249.
Based on my colleagues' research,

Root cause:

fails intermittently because of use of fixed ports. These ports could be 
busy at some configurations.

Suggested fix:
1. My recommendation would be to convert the only shell test 
(SSLConfigFilePermissionTest.sh) into
Java based test and re-use the dynamic port allocation 
solutionjdk/test/lib/testlibrary/jdk/testlibrary/Utils.getFreePort() to 
address the issue for JDK tests. Staffan Larsen recommends to use this 
solution instead of java/rmi/testlibrary/TestLibrary.getUnusedRandomPort().

2. For hotspot tests I cannot find appropriate test utils (witch provide 
getFreePort() functionality). There are several options:
- copy whole library jdk/test/lib/testlibrary/jdk/testlibrary/ to 
hotspot repository;
- copy one class jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java to 
hotspot repository;
- copy one method from class 
(Utils.getFreePort()) to hotspot repository;
- move the library jdk/test/lib/testlibrary/jdk/testlibrary/ to a place 
that can be shared between hotspot & jdk tests (if such place exists).

3. SourceDebugExtension test uses jtreg tag @run with hard coded port in 
jvm options. The test must be converted to test with java based test 
launcher and test application (e.g. like the test LocalManagementTest.java).

Please let me know any comments or suggestions.

Thank you

With best regards,
Taras Ledkov
Mail-To: taras.ledkov at oracle.com
skype: taras_ledkov
Phone: 7(812)3346-157

More information about the serviceability-dev mailing list