RFR(XS): 8166045: jdk/internal/misc/Unsafe tests fail due to timeout
david.holmes at oracle.com
Mon Sep 26 22:46:36 UTC 2016
Changes seem okay to me.
Should the tests have an appropriate @bug line?
On 27/09/2016 7:53 AM, Mikael Vidstedt wrote:
> Please review the following change:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8166045 <https://bugs.openjdk.java.net/browse/JDK-8166045>
> Webrev: http://cr.openjdk.java.net/~mikael/webrevs/8166045/webrev.01/jdk/webrev/ <http://cr.openjdk.java.net/~mikael/webrevs/8166045/webrev.01/jdk/webrev/>
> Among the tests I introduced for Unsafe.copyMemory and Unsafe.copySwapMemory a few months ago are a couple of tests which rely on being able to allocate and operate on a large (~2GB) block of native memory. However, on some smallish machines the actual allocation succeeds, but the machine then goes on to swap (as in, page to/from disk) like crazy, making the test time out.
> In an attempt to work around this I’m using @requires in combination with the value of os.maxMemory. I could make the whole test(s) conditional on the memory size, but the vast majority of the test(s) actually operate on a very small block of memory (tens of bytes), so disabling the whole test seems unfortunate. Instead I decided to split up the test(s) in two - one set which tests the default/small size, and one set which tests the large size iff there is enough memory on the machine.
> I have tested manually that the @requires check has the right effect - the tests are skipped if there’s not enough memory on the machine - and that the tests still pass as expected.
> I also took the liberty of removing a superfluous import.
More information about the hotspot-dev