changeset 9691:f1cc18a769e5

6815126: intermittent SimulResumerTest.java failure Reviewed-by: jbachorik, sla
author sjiang
date Tue, 08 Apr 2014 17:36:13 +0200
parents d6f75dd238c8
children 656a8718f0d3
files test/com/sun/jdi/SimulResumerTest.java
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/jdi/SimulResumerTest.java	Tue Apr 08 11:25:56 2014 +0100
+++ b/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()";