6815126: intermittent SimulResumerTest.java failure
authorsjiang
Tue, 08 Apr 2014 17:36:13 +0200
changeset 23728 0db9dcaf1036
parent 23727 c7c05d5eb440
child 23730 c35edcf0144e
6815126: intermittent SimulResumerTest.java failure Reviewed-by: jbachorik, sla
jdk/test/com/sun/jdi/SimulResumerTest.java
--- a/jdk/test/com/sun/jdi/SimulResumerTest.java	Tue Apr 08 11:25:56 2014 +0100
+++ b/jdk/test/com/sun/jdi/SimulResumerTest.java	Tue Apr 08 17:36:13 2014 +0200
@@ -177,12 +177,18 @@
                 List<StackFrame> frames = thr.frames();
                 // no failure return value here; could cause an NPE
 
+                kind = "frames(0, size - 1)";
+                System.out.println("kind = " + kind);
                 int nframes = frames.size();
-                if (nframes > 0) {
-                    // hmm, how could it ever be 0?
-                    kind = "frames(0, size - 1)";
-                System.out.println("kind = " + kind);
-                    thr.frames(0, frames.size() - 1);
+                while (nframes > 0) {
+                    try {
+                        thr.frames(0, nframes - 1);
+                        break;
+                    } catch (IndexOutOfBoundsException iobe) {
+                        // 6815126. let's try to get less frames
+                        iobe.printStackTrace();
+                        nframes--;
+                    }
                 }
 
                 kind = "frameCount()";