Repository: ambari Updated Branches: refs/heads/trunk 298d8109a -> 4e04189d7
AMBARI-8661. Distribute Repositories/Install Components - fix missing INSTALLING->INSTALL_FAILED transition on multinode cluster (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4e04189d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4e04189d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4e04189d Branch: refs/heads/trunk Commit: 4e04189d7071b44b74ced36801cb157416373bb1 Parents: 298d810 Author: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Authored: Thu Dec 11 18:14:54 2014 +0200 Committer: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Committed: Thu Dec 11 19:48:54 2014 +0200 ---------------------------------------------------------------------- .../org/apache/ambari/server/state/cluster/ClusterImpl.java | 5 ++++- .../ambari/server/actionmanager/TestActionScheduler.java | 7 +++---- .../internal/ClusterStackVersionResourceProviderTest.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4e04189d/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java index 9848069..ed9b0e7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java @@ -1263,8 +1263,11 @@ public class ClusterImpl implements Cluster { throw new AmbariException(String.format("Repo version %s is not installed on host %s", repositoryVersion, hostName)); } - if (hostVersion.getState() != worstState) { + if (hostVersion.getState() == RepositoryVersionState.INSTALL_FAILED) { worstState = hostVersion.getState(); + break; + } else if (hostVersion.getState() == RepositoryVersionState.INSTALLING) { + worstState = RepositoryVersionState.INSTALLING; } } if (worstState != clusterVersion.getState()) { http://git-wip-us.apache.org/repos/asf/ambari/blob/4e04189d/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java index b389644..d14f126 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java @@ -263,7 +263,6 @@ public class TestActionScheduler { } - @Ignore @Test public void testActionTimeoutForLostHost() throws Exception { ActionQueue aq = new ActionQueue(); @@ -314,9 +313,10 @@ public class TestActionScheduler { }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString()); //Small action timeout to test rescheduling + AmbariEventPublisher aep = EasyMock.createNiceMock(AmbariEventPublisher.class); ActionScheduler scheduler = EasyMock.createMockBuilder(ActionScheduler.class). withConstructor((long) 100, (long) 50, db, aq, fsm, 3, - new HostsMap((String) null), unitOfWork, EasyMock.anyObject(AmbariEventPublisher.class), null, conf). + new HostsMap((String) null), unitOfWork, aep, conf). addMockedMethod("cancelHostRoleCommands"). createMock(); scheduler.cancelHostRoleCommands((Collection<HostRoleCommand>)EasyMock.anyObject(),EasyMock.anyObject(String.class)); @@ -1006,7 +1006,6 @@ public class TestActionScheduler { Assert.assertEquals(HostRoleStatus.QUEUED, stages.get(1).getHostRoleStatus(hostname1, "GANGLIA_MONITOR")); } - @Ignore @Test public void testRequestFailureOnStageFailure() throws Exception { ActionQueue aq = new ActionQueue(); @@ -1116,7 +1115,7 @@ public class TestActionScheduler { ActionScheduler scheduler = EasyMock.createMockBuilder(ActionScheduler.class). withConstructor((long)100, (long)50, db, aq, fsm, 3, new HostsMap((String) null), - unitOfWork, null, conf). + unitOfWork, EasyMock.createNiceMock(AmbariEventPublisher.class), conf). addMockedMethod("cancelHostRoleCommands"). createMock(); scheduler.cancelHostRoleCommands(EasyMock.capture(cancelCommandList), http://git-wip-us.apache.org/repos/asf/ambari/blob/4e04189d/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java index d9b7b2a..5175b87 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java @@ -64,7 +64,6 @@ import org.apache.ambari.server.state.StackInfo; import org.apache.ambari.server.state.fsm.InvalidStateTransitionException; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; @@ -140,7 +139,6 @@ public class ClusterStackVersionResourceProviderTest { injector.getInstance(PersistService.class).stop(); } - @Ignore @Test public void testCreateResources() throws Exception { Resource.Type type = Resource.Type.ClusterStackVersion; @@ -224,6 +222,8 @@ public class ClusterStackVersionResourceProviderTest { // add properties to the request map properties.put(ClusterStackVersionResourceProvider.CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID, "Cluster100"); properties.put(ClusterStackVersionResourceProvider.CLUSTER_STACK_VERSION_REPOSITORY_VERSION_PROPERTY_ID, "2.2.0.1-885"); + properties.put(ClusterStackVersionResourceProvider.CLUSTER_STACK_VERSION_STACK_PROPERTY_ID, "HDP"); + properties.put(ClusterStackVersionResourceProvider.CLUSTER_STACK_VERSION_VERSION_PROPERTY_ID, "2.0.7"); propertySet.add(properties);