helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject git commit: [HELIX-7] Tune test parameters to fix random test failures
Date Thu, 15 Nov 2012 04:12:09 GMT
Updated Branches:
  refs/heads/master 2d2b85f94 -> 4167d3771


[HELIX-7] Tune test parameters to fix random test failures

Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/4167d377
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/4167d377
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/4167d377

Branch: refs/heads/master
Commit: 4167d37719f8efbd6cddc3a8d1b803fdd72e519f
Parents: 2d2b85f
Author: slu2011 <lushi04@gmail.com>
Authored: Wed Nov 14 20:11:52 2012 -0800
Committer: slu2011 <lushi04@gmail.com>
Committed: Wed Nov 14 20:11:52 2012 -0800

----------------------------------------------------------------------
 .../TestClusterAlertItemMBeanCollection.java       |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/4167d377/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAlertItemMBeanCollection.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAlertItemMBeanCollection.java
b/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAlertItemMBeanCollection.java
index 56d5551..997a81e 100644
--- a/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAlertItemMBeanCollection.java
+++ b/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAlertItemMBeanCollection.java
@@ -250,10 +250,17 @@ public class TestClusterAlertItemMBeanCollection
     beanCollection.setAlerts(originAlert1, alertResultMap1, clusterName);
     beanCollection.checkMBeanFreshness(200);
     
-    Thread.sleep(500);
-    
-    jmxMBeanObserver.refresh();
-    
+    for(int i = 0; i < 10; i++)
+    {
+      Thread.sleep(500);
+      
+      jmxMBeanObserver.refresh();
+      
+      if(jmxMBeanObserver._beanValueMap.size() == nAlerts1 + 1)
+      {
+        break;
+      }
+    }
     Assert.assertEquals(jmxMBeanObserver._beanValueMap.size(), nAlerts1 + 1);
   }
 }


Mime
View raw message