[crac] RFR: 8362837: [CRaC] jdk/crac/MXBean.java can fail on macOS [v2]

Timofei Pushkin tpushkin at openjdk.org
Sun Jul 20 19:52:04 UTC 2025


On Sun, 20 Jul 2025 19:43:19 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> test/jdk/jdk/crac/MXBean.java line 79:
>> 
>>> 77:             long restoreTimePassed = System.currentTimeMillis() - restoreStart;
>>> 78:             System.err.println("restoreTimePassed="+restoreTimePassed);
>>> 79:             if (restoreTimePassed < 0 || TIME_TOLERANCE < restoreTimePassed) {
>> 
>> What is the purpose of this check? As I understand it, it checks that restore + restored code execution takes time close to zero which I don't think is a reasonable expectation (it passes because the tolerance is high).
>> 
>> Also the test is supposed to be about `CRaCMXBean` which is not involved here.
>
> This check is implementing your words:
> 
>> For platforms that have engines with restore time passing (only Linux currently, I think pauseengine is enough here) — this will be almost the same test as it is now, but it will do an actual restore call and measure the restore start time from that call.
> 
> Regarding `CRaCMXBean` - I do not see any need for it to implement your words above. Although maybe I did not understand it as I do not see why/how to use `pauseengine` when you want `actual restore call`.

I meant recording the time of restore start and then comparing it with the restore start time `MXBean` provides. 

`pauseengine` should be enough because we need an engine that allows to start restoring at some particular moment, not immediately after checkpoint as `simengine` does.

Anyway, I posted the code that implements what I meant, it should be clearer.

-------------

PR Review Comment: https://git.openjdk.org/crac/pull/246#discussion_r2217935008


More information about the crac-dev mailing list