RFR: 7904105: intermittent test failure in CleanupDirTests.agentvm.conc
Vladimir Petko
vpetko at openjdk.org
Tue Oct 28 19:49:58 UTC 2025
On Tue, 28 Oct 2025 08:45:47 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> Hello Vladimir, we have seen intermittent failure in this test too, but i haven't had a chance to look deeper.
>
> `TestStats` deals with counts in several different methods, so I'm not completely sure the proposed change is enough or the best way to address this. It may be that the code in `TestStats` itself might need to be addressed in some manner.
Hi,
I have tried using atomics in TestStats and the implementation looked ugly / required a lot of refactoring.
We already use `synchonzied` keyword in Observer callbacks[1] as the TestRunner may spawn multiple threads if we specify concurrency > 1. I have used Intellij Idea to find all inheritors of BasicObserver and added synchronization.
Maybe the better way would be to synchronize in jtharness itself to avoid doing it in the client code?
[1] https://github.com/openjdk/jtreg/blob/34ccc66ec89651637811678a17d3f810b4ac0780/src/share/classes/com/sun/javatest/regtest/report/ElapsedTimeHandler.java#L64
-------------
PR Comment: https://git.openjdk.org/jtreg/pull/297#issuecomment-3458212429
More information about the jtreg-dev
mailing list