8168141: javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java: No notif received!
authorvtewari
Mon, 14 Nov 2016 12:05:26 +0530
changeset 42677 d2c15c981e72
parent 42676 36fa143f8de8
child 42678 9873beb737e9
8168141: javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java: No notif received! Summary: changed the time limit of 2 seconds for getting notification to default jtreg timeout. Reviewed-by: rehn, dholmes Contributed-by: ujwal.vangapally@oracle.com
jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
--- a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java	Mon Nov 07 16:14:18 2016 -0800
+++ b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java	Mon Nov 14 12:05:26 2016 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,20 +103,13 @@
         mbsc.invoke(mbean, "emitNotification", null, null);
 
         System.out.println("EmptyDomainNotificationTest-main: waiting notif...");
-        final long stopTime = System.currentTimeMillis() + 2000;
         synchronized(li) {
-            long toWait = stopTime - System.currentTimeMillis();
-
-            while (li.received < 1 && toWait > 0) {
-                li.wait(toWait);
-
-                toWait = stopTime - System.currentTimeMillis();
+            while (li.received < 1) {
+                li.wait();
             }
         }
 
-        if (li.received < 1) {
-            throw new RuntimeException("No notif received!");
-        } else if (li.received > 1) {
+        if (li.received != 1) {
             throw new RuntimeException("Wait one notif but got: "+li.received);
         }