Integrated: 8357910: LoaderConstraintsTest.java fails when run with TEST_THREAD_FACTORY=Virtual
    Patricio Chilano Mateo 
    pchilanomate at openjdk.org
       
    Tue Jun  3 16:16:03 UTC 2025
    
    
  
On Wed, 28 May 2025 14:42:10 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> Please review this small test fix. When running LoaderConstraintsTest with `TEST_THREAD_FACTORY=Virtual` we load class `java.lang.Class` earlier than expected which causes the test to fail because of a missing loader constraint logging output. I added the full details of the issue in the JBS comments. 
> 
> The fix changes the constraint we look for to be on class `java.lang.String` between classloader `ClassUnloadCommonClassLoader` and the bootstrap classloader. This allows the test to be more robust and not depend on some hidden behavior. In fact, the only line that is currently needed for the test to pass for the platform thread case is the call to `ClassUnloadCommon.newClassLoader()`, which seems a bit obscure. Also as explained in JBS, the defining loader of `test.Empty` is currently the builtin system classloader, not `ClassUnloadCommonClassLoader` as the test would suggest.
> 
> Thanks,
> Patricio
This pull request has now been integrated.
Changeset: 16e120b0
Author:    Patricio Chilano Mateo <pchilanomate at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/16e120b00842e340401b6930354edfb1515f6ca4
Stats:     13 lines in 2 files changed: 5 ins; 3 del; 5 mod
8357910: LoaderConstraintsTest.java fails when run with TEST_THREAD_FACTORY=Virtual
Reviewed-by: dholmes, coleenp
-------------
PR: https://git.openjdk.org/jdk/pull/25496
    
    
More information about the hotspot-runtime-dev
mailing list