# HG changeset patch # User goetz # Date 1529926621 -7200 # Mon Jun 25 13:37:01 2018 +0200 # Node ID 9018f7d00e510497b55c77297ce6a127c43f29a9 # Parent d9132bdf6c30e8025aafa517261ad3ed4ff3a466 8205605: [testbug][aix] Various test adaption to aix pecularities. diff --git a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java --- a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java +++ b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java @@ -45,6 +45,8 @@ * @test TestInheritFD * @bug 8176717 8176809 * @summary a new process should not inherit open file descriptors + * @comment On Aix lsof requires root privileges. + * @requires os.family != "aix" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java b/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java --- a/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java +++ b/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,13 @@ * questions. * */ -/* + +/** * @test * @bug 8067744 + * @comment Test uses custom launcher that starts VM in primordial thread. This is + * not possible on aix. + * @requires os.family != "aix" * @library /test/lib * @modules java.base/jdk.internal.misc * @run main/native FPRegs diff --git a/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java b/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java --- a/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java +++ b/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java @@ -43,6 +43,7 @@ */ import sun.hotspot.WhiteBox; +import jdk.test.lib.Platform; public class WBStackSize { @@ -83,18 +84,40 @@ } public static void main(String[] args) { + long pageSize = wb.getVMPageSize(); + long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K; System.out.println("ThreadStackSize VM option: " + configStackSize); - long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * wb.getVMPageSize(); + long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * pageSize; System.out.println("Size of protected shadow pages: " + stackProtectionSize); long actualStackSize = wb.getThreadStackSize(); System.out.println("Full stack size: " + actualStackSize); - if (Math.abs(actualStackSize - configStackSize) > configStackSize * 0.1) { - throw new RuntimeException("getThreadFullStackSize value [" + actualStackSize - + "] should be within 90%..110% of ThreadStackSize value"); + if (!Platform.isAix()) { + if (Math.abs(actualStackSize - configStackSize) > configStackSize * 0.1) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should be within 90%..110% of ThreadStackSize value"); + } + } else { + // AIX pthread implementation returns stacks with sizes varying a lot. + // We add +64K to assure stacks are not too small, thus we get + // even more variation to bigger sizes. So only check the lower bound. + // Allow for at least one page deviation. + long slack = (long)(configStackSize * 0.1); + if (slack < pageSize) { + if (configStackSize - actualStackSize > pageSize) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should not be more than one page smaller than " + + "ThreadStackSize value"); + } + } else { + if (configStackSize - actualStackSize > slack) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should not be less than 90% of ThreadStackSize value"); + } + } } long remainingStackSize = wb.getThreadRemainingStackSize(); diff --git a/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java b/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java --- a/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java +++ b/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java @@ -27,6 +27,7 @@ * @summary Tests that jvmtiEnv::GetPotentialCapabilities reports * can_generate_all_class_hook_events capability with CDS (-Xshare:on) * at ONLOAD and LIVE phases + * @requires vm.cds * @library /test/lib * @compile CanGenerateAllClassHook.java * @run main/othervm/native CanGenerateAllClassHook