< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/instances/instances003/instances003.java

Print this page

        

@@ -39,10 +39,11 @@
  *                 - initiate GarbageCollection in Debuggee VM
  *                 - check the number of instances is 0
  *         done
  *         Test is executed for following sublcasses of ObjectReference: StringReference, ThreadReference, ClassLoaderReference
  *
+ * @requires vm.gc != "Z"
  * @library /vmTestbase
  *          /test/lib
  * @run driver jdk.test.lib.FileInstaller . .
  * @build nsk.jdi.ReferenceType.instances.instances003.instances003
  * @run main/othervm/native PropertyResolvingWrapper

@@ -123,10 +124,15 @@
         // during the time between creating them and disabling collection on them
         pipe.println(HeapwalkingDebuggee.COMMAND_CREATE_INSTANCES + ":" + className + ":" + createInstanceCount +
             ":" + referrerCount + ":" + referrerType +
             (referrerType.equals(ObjectInstancesManager.WEAK_REFERENCE) ? "|" + ObjectInstancesManager.STRONG_REFERENCE : ""));
 
+        // Note! This test is broken, in the sense that it incorrectly assumes
+        // that no GC can happen before it walks the heap. In practice, it seems
+        // to only affect this test when using ZGC. However, this test will also
+        // fail when using other GCs if an explicit GC is done here.
+
         // the instance counts should not be affected by creating multiple references
         checkDebugeeAnswer_instanceCounts(className, createInstanceCount, objectsToFilter);
 
         ReferenceType referenceType = debuggee.classByName(className);
         List<ObjectReference> instances = HeapwalkingDebugger.filterObjectReferrence(objectsToFilter, referenceType.instances(0));
< prev index next >