You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by sl...@apache.org on 2013/01/02 19:59:58 UTC
git commit: [HELIX-7]Tune test parameters to fix random test failures
Updated Branches:
refs/heads/master 6100c0861 -> f7cc98631
[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/f7cc9863
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/f7cc9863
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/f7cc9863
Branch: refs/heads/master
Commit: f7cc98631ef9e82f90b8ca90cda50a40b7811ac8
Parents: 6100c08
Author: slu2011 <lu...@gmail.com>
Authored: Wed Jan 2 10:59:15 2013 -0800
Committer: slu2011 <lu...@gmail.com>
Committed: Wed Jan 2 10:59:15 2013 -0800
----------------------------------------------------------------------
.../helix/healthcheck/TestWildcardAlert.java | 5 +++--
.../helix/integration/TestSchedulerMessage.java | 9 +++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f7cc9863/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java b/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
index c18769a..20f0c13 100644
--- a/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/healthcheck/TestWildcardAlert.java
@@ -24,6 +24,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
@@ -72,7 +73,7 @@ public class TestWildcardAlert extends ZkIntegrationTestBase
{
public static class TestClusterMBeanObserver extends ClusterMBeanObserver
{
- public Map<String, Map<String, Object>> _beanValueMap = new HashMap<String, Map<String, Object>>();
+ public Map<String, Map<String, Object>> _beanValueMap = new ConcurrentHashMap<String, Map<String, Object>>();
public TestClusterMBeanObserver(String domain) throws InstanceNotFoundException, IOException,
MalformedObjectNameException, NullPointerException
@@ -88,7 +89,7 @@ public class TestWildcardAlert extends ZkIntegrationTestBase
{
MBeanInfo info = _server.getMBeanInfo(mbsNotification.getMBeanName());
MBeanAttributeInfo[] infos = info.getAttributes();
- _beanValueMap.put(mbsNotification.getMBeanName().toString(), new HashMap<String, Object>());
+ _beanValueMap.put(mbsNotification.getMBeanName().toString(), new ConcurrentHashMap<String, Object>());
for (MBeanAttributeInfo infoItem : infos)
{
Object val = _server.getAttribute(mbsNotification.getMBeanName(), infoItem.getName());
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f7cc9863/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
index 2ee8a02..98421c3 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
@@ -169,6 +169,15 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBaseWithPropertyServ
schedulerMessage);
Thread.sleep(15000);
+
+ for(int i = 0; i < 30; i++)
+ {
+ Thread.sleep(2000);
+ if(_PARTITIONS == _factory._results.size())
+ {
+ break;
+ }
+ }
Assert.assertEquals(_PARTITIONS, _factory._results.size());
PropertyKey controllerTaskStatus = keyBuilder.controllerTaskStatus(