You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2018/01/03 22:52:23 UTC
[1/2] storm git commit: STORM-2872: TestRebalance can be flaky -
fixing
Repository: storm
Updated Branches:
refs/heads/master 69e596ac6 -> 73e5f6746
STORM-2872: TestRebalance can be flaky - fixing
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/c09013a1
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/c09013a1
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/c09013a1
Branch: refs/heads/master
Commit: c09013a1afde86d61350a854d2ab2684b9c6517e
Parents: 4fd02ca
Author: Govind Menon <go...@gmail.com>
Authored: Tue Jan 2 15:56:03 2018 -0600
Committer: Govind Menon <go...@gmail.com>
Committed: Tue Jan 2 16:24:54 2018 -0600
----------------------------------------------------------------------
.../java/org/apache/storm/TestRebalance.java | 23 +++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/c09013a1/storm-server/src/test/java/org/apache/storm/TestRebalance.java
----------------------------------------------------------------------
diff --git a/storm-server/src/test/java/org/apache/storm/TestRebalance.java b/storm-server/src/test/java/org/apache/storm/TestRebalance.java
index 26a8f7f..912ad42 100644
--- a/storm-server/src/test/java/org/apache/storm/TestRebalance.java
+++ b/storm-server/src/test/java/org/apache/storm/TestRebalance.java
@@ -41,6 +41,7 @@ import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class TestRebalance {
@@ -62,6 +63,9 @@ public class TestRebalance {
conf.put(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB, 10.0);
conf.put(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB, 100.0);
conf.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, Double.MAX_VALUE);
+ Map<String, Double> resourcesMap = new HashMap();
+ resourcesMap.put("gpu.count", 5.0);
+ conf.put(Config.TOPOLOGY_COMPONENT_RESOURCES_MAP, resourcesMap);
try (ILocalCluster cluster = new LocalCluster.Builder().withDaemonConf(conf).build()) {
@@ -102,12 +106,21 @@ public class TestRebalance {
waitTopologyScheduled(topoName, cluster, 10);
- String confRaw = cluster.getTopologyConf(topoNameToId(topoName, cluster));
-
+ boolean topologyUpdated = false;
JSONParser parser = new JSONParser();
- JSONObject readConf = (JSONObject) parser.parse(confRaw);
- assertEquals("updated conf correct", 768.0, (double) readConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB), 0.001);
+ for (int i = 0; i < 5; i++) {
+ Utils.sleep(SLEEP_TIME_BETWEEN_RETRY);
+
+ String confRaw = cluster.getTopologyConf(topoNameToId(topoName, cluster));
+
+
+ JSONObject readConf = (JSONObject) parser.parse(confRaw);
+ if (768.0 == (double) readConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB)) {
+ topologyUpdated = true;
+ break;
+ }
+ }
StormTopology readStormTopology = cluster.getTopology(topoNameToId(topoName, cluster));
String componentConfRaw = readStormTopology.get_spouts().get("spout-1").get_common().get_json_conf();
@@ -115,7 +128,7 @@ public class TestRebalance {
JSONObject readTopologyConf = (JSONObject) parser.parse(componentConfRaw);
Map<String, Double> componentResources = (Map<String, Double>) readTopologyConf.get(Config.TOPOLOGY_COMPONENT_RESOURCES_MAP);
-
+ assertTrue("Topology has been updated", topologyUpdated);
assertEquals("Updated CPU correct", 25.0, componentResources.get(Constants.COMMON_CPU_RESOURCE_NAME), 0.001);
assertEquals("Updated Memory correct", 120.0, componentResources.get(Constants.COMMON_ONHEAP_MEMORY_RESOURCE_NAME), 0.001);
assertEquals("Updated Generic resource correct", 5.0, componentResources.get("gpu.count"), 0.001);
[2/2] storm git commit: Merge branch 'YSTORM-4457-II' of
https://github.com/govind-menon/storm into STORM-2872
Posted by bo...@apache.org.
Merge branch 'YSTORM-4457-II' of https://github.com/govind-menon/storm into STORM-2872
STORM-2872: TestRebalance can be flaky
This closes #2491
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/73e5f674
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/73e5f674
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/73e5f674
Branch: refs/heads/master
Commit: 73e5f6746cab33b5dcb616b8bad3c0bb00d796f4
Parents: 69e596a c09013a
Author: Robert Evans <ev...@yahoo-inc.com>
Authored: Wed Jan 3 16:24:54 2018 -0600
Committer: Robert Evans <ev...@yahoo-inc.com>
Committed: Wed Jan 3 16:24:54 2018 -0600
----------------------------------------------------------------------
.../java/org/apache/storm/TestRebalance.java | 23 +++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------