AMBARI-21714. Intermittent unit test failure in ExecutionCommandWrapperTest


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f134cee0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f134cee0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f134cee0

Branch: refs/heads/branch-feature-logsearch-ui
Commit: f134cee07e9685a5a86fe73162b9a00bf60a9fef
Parents: 4e3f7eb
Author: Attila Doroszlai <adorosz...@hortonworks.com>
Authored: Mon Aug 14 13:04:10 2017 +0200
Committer: Attila Doroszlai <adorosz...@hortonworks.com>
Committed: Mon Aug 14 13:04:10 2017 +0200

----------------------------------------------------------------------
 .../actionmanager/ExecutionCommandWrapperTest.java      | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f134cee0/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
index 52d54aa..7d97ee1 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
@@ -113,6 +113,10 @@ public class ExecutionCommandWrapperTest {
 
     Cluster cluster1 = clusters.getCluster(CLUSTER1);
 
+    OrmTestHelper helper = injector.getInstance(OrmTestHelper.class);
+    RepositoryVersionEntity repositoryVersion = 
helper.getOrCreateRepositoryVersion(cluster1);
+    cluster1.addService("HDFS", repositoryVersion);
+
     SERVICE_SITE_CLUSTER = new HashMap<>();
     SERVICE_SITE_CLUSTER.put(SERVICE_SITE_NAME1, SERVICE_SITE_VAL1);
     SERVICE_SITE_CLUSTER.put(SERVICE_SITE_NAME2, SERVICE_SITE_VAL2);
@@ -167,14 +171,6 @@ public class ExecutionCommandWrapperTest {
 
   @Test
   public void testGetExecutionCommand() throws JSONException, AmbariException {
-
-    Cluster cluster = clusters.getCluster(CLUSTER1);
-
-    OrmTestHelper helper = injector.getInstance(OrmTestHelper.class);
-    RepositoryVersionEntity repositoryVersion = 
helper.getOrCreateRepositoryVersion(cluster);
-
-    cluster.addService("HDFS", repositoryVersion);
-
     Map<String, Map<String, String>> confs = new HashMap<>();
     Map<String, String> configurationsGlobal = new HashMap<>();
     configurationsGlobal.put(GLOBAL_NAME1, GLOBAL_VAL1);

Reply via email to