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/2d52cfb3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2d52cfb3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2d52cfb3

Branch: refs/heads/branch-feature-AMBARI-21450
Commit: 2d52cfb37cb59fdbeafc97bbcfa3417d9e658c2f
Parents: d9d58fd
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 19:31:24 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d52cfb3/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 f68f639..94ad0d5 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
@@ -114,6 +114,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);
@@ -172,14 +176,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