8175033: (se) Improve internal timing of java/nio/channels/Selector/WakeupAfterClose.java
authorbpb
Thu, 16 Feb 2017 12:26:23 -0800
changeset 43815 5fde21996e78
parent 43814 c175b059160b
child 43816 1f49172925e2
8175033: (se) Improve internal timing of java/nio/channels/Selector/WakeupAfterClose.java Summary: Add print of expected ClosedSelectorException Reviewed-by: alanb
jdk/test/java/nio/channels/Selector/WakeupAfterClose.java
--- a/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java	Thu Feb 16 18:28:01 2017 +0000
+++ b/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java	Thu Feb 16 12:26:23 2017 -0800
@@ -27,8 +27,9 @@
  * @key intermittent
  */
 
+import java.io.IOException;
+import java.nio.channels.ClosedSelectorException;
 import java.nio.channels.Selector;
-import java.io.IOException;
 
 public class WakeupAfterClose {
 
@@ -41,6 +42,9 @@
                     sel.select();
                 } catch (IOException x) {
                     x.printStackTrace();
+                } catch (ClosedSelectorException y) {
+                    System.err.println
+                        ("Caught expected ClosedSelectorException");
                 }
             }
         };