RFR: 8346929: runtime/ClassUnload/DictionaryDependsTest.java fails with "Test failed: should be unloaded" [v2]
Coleen Phillimore
coleenp at openjdk.org
Mon Jan 13 12:52:43 UTC 2025
On Mon, 13 Jan 2025 04:30:42 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> So `interfaceName` is not expected to be unloaded so `triggerUnloading` would run the full 2 seconds failing to detect it is unloaded, if it was passed in. But surely you would just use WB to test if a class is still loaded as expected?
>
> Seems pretty evident from the `failIf` calls what is expected. The comment is just confusing to me.
I guess it's confusing but I'm trying to say why not this:
ClassUnloadCommmon.triggerUnloading(List.of(className, interfaceName));
ClassUnloadCommon.failIf(wb.isClassAlive(className), "should be unloaded");
ClassUnloadCommon.failIf(!wb.isClassAlive(interfaceName), "should be live here");
Which would be a better test since interfaceName should not be unloaded because it's referenced and not because we didn't try hard enough in the loop to wait for other things like the compiler to stop referencing it. But I didn't want to do that because it would make the test run longer in order to wait for it not to unload.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22974#discussion_r1913141286
More information about the hotspot-runtime-dev
mailing list