[crac] RFR: 8364931: [CRaC] Stabilize recompiler tests
Timofei Pushkin
tpushkin at openjdk.org
Fri Aug 8 12:55:28 UTC 2025
On Fri, 8 Aug 2025 12:08:06 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> Stabilizes recompiler tests:
>> - `NaturalDecompilationTest` now ensures the method is not enqueued for another compilation before proceeding with the test.
>> - In `RecompilationFlagsTest` recompilation waiting period of a predefined length is replaced with waiting for the methods to get enqueued and dequeued to/from the compilation queue.
>
> test/jdk/jdk/crac/recompiler/RecompilationFlagsTest.java line 164:
>
>> 162: recompilerThread.join();
>> 163: } else {
>> 164: System.out.println("Recompiler thread not set");
>
> You could assert that the thread is present or not based on the test parameters.
This should actually never happen with the current implementation (the method is only used when the delay is used). I did it this way instead of `assertNotNull`in case we change the implementation to set the field to null after the thread finishes — this will be a data race and the test will start failing sometimes.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/259#discussion_r2262893826
More information about the crac-dev
mailing list