test/hotspot/jtreg/vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java
changeset 50525 767cdb97f103
parent 50317 cf71bff5f533
child 51135 610d15624bdd
equal deleted inserted replaced
50524:04f4e983c2f7 50525:767cdb97f103
    58  *         - create command with typeID = -1, expect INVALID_OBJECT error
    58  *         - create command with typeID = -1, expect INVALID_OBJECT error
    59  *         - create command with threadID instead of referenceTypeID, expect INVALID_CLASS error
    59  *         - create command with threadID instead of referenceTypeID, expect INVALID_CLASS error
    60  *     Finally, debugger sends debuggee signal to quit, waits for it exits
    60  *     Finally, debugger sends debuggee signal to quit, waits for it exits
    61  *     and exits too with the proper exit code.
    61  *     and exits too with the proper exit code.
    62  *
    62  *
       
    63  * @requires vm.gc != "Z"
    63  * @library /vmTestbase /test/hotspot/jtreg/vmTestbase
    64  * @library /vmTestbase /test/hotspot/jtreg/vmTestbase
    64  *          /test/lib
    65  *          /test/lib
    65  * @run driver jdk.test.lib.FileInstaller . .
    66  * @run driver jdk.test.lib.FileInstaller . .
    66  * @build nsk.jdwp.ReferenceType.Instances.instances001.instances001
    67  * @build nsk.jdwp.ReferenceType.Instances.instances001.instances001
    67  * @run main/othervm/native PropertyResolvingWrapper
    68  * @run main/othervm/native PropertyResolvingWrapper
   154 
   155 
   155         String testClassName = nsk.jdwp.ReferenceType.Instances.instances001.TestClass.class.getName();
   156         String testClassName = nsk.jdwp.ReferenceType.Instances.instances001.TestClass.class.getName();
   156 
   157 
   157         long typeID = debuggee.getReferenceTypeID(createTypeSignature(testClassName));
   158         long typeID = debuggee.getReferenceTypeID(createTypeSignature(testClassName));
   158 
   159 
       
   160         // Note! This test is broken, in the sense that it incorrectly assumes
       
   161         // that no GC can happen before it walks the heap. In practice, it seems
       
   162         // to only affect this test when using ZGC. However, this test will also
       
   163         // fail when using other GCs if an explicit GC is done here.
   159 
   164 
   160         // create command with maxInstances=1, only 1 instance should be returned
   165         // create command with maxInstances=1, only 1 instance should be returned
   161         testClass(typeID, 1, 1, false, 0);
   166         testClass(typeID, 1, 1, false, 0);
   162         // create command with maxInstances=0, all instances should be returned
   167         // create command with maxInstances=0, all instances should be returned
   163         testClass(typeID, 0, expectedInstances, false, 0);
   168         testClass(typeID, 0, expectedInstances, false, 0);