On Tue, 21 Feb 2023 20:27:44 GMT, Martin Buchholz <mar...@openjdk.org> wrote:
>> jtreg will look after this. The default timeout is 120s but it can be >> adjusted with a timeout factor (make time uses a timeout factor of 4). So it >> would be possible to put a limit on this in the test but it can be >> problematic, e.g. with debug builds + Xcomp for example. > > I have written such code many times, and I've always had success with a > (jtreg-scaled) 10 second timeout. E.g. > > static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000); > > (But that's before I became aware of existence of (slow) Raspberry Pis.) > > I continue to feel guilty about never having written a proper gc awaiting > library utility for openjdk, like I did for guava here: > > https://github.com/google/guava/blob/master/guava-testlib/src/com/google/common/testing/GcFinalization.java Now there's [jdk.test.lib.util.ForceGC](https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/util/ForceGC.java). ------------- PR: https://git.openjdk.org/jdk/pull/12675