[crac] RFR: 8364931: [CRaC] Stabilize recompiler tests
Timofei Pushkin
tpushkin at openjdk.org
Fri Aug 8 12:47:30 UTC 2025
On Fri, 8 Aug 2025 11:55:01 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/NaturalDecompilationTest.java line 163:
>
>> 161: // Utils.waitForCondition() invokes its supplier argument one more time
>> 162: // after it returns true. For our conditions that is unacceptable.
>> 163: final var result = new Object() { boolean value = false; };
>
> TBH I would use `AtomicBoolean` for a mutable bool wrapper but YMMV.
Since this used by a single thread I'll leave it as is.
I agree that `AtomicBoolean` may give better readability but it may also be confusing since it suggests some kind of concurrency.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/259#discussion_r2262878306
More information about the crac-dev
mailing list