internal async Task <bool> IsInterruptibleAsync(ClusterUpgradeStateBase clusterUpgradeState) { if (!clusterUpgradeState.CanInterruptUpgrade()) { return(false); } FabricUpgradeProgress fabricUpgradeProgress = await FabricClientRetryHelper.ExecuteFabricActionWithRetryAsync( () => this.fabricClient.ClusterManager.GetFabricUpgradeProgressAsync(Constants.UpgradeServiceMaxOperationTimeout, this.cancellationToken), Constants.UpgradeServiceMaxOperationTimeout, this.cancellationToken).ConfigureAwait(false); return(fabricUpgradeProgress.UpgradeState != FabricUpgradeState.RollingBackInProgress); }
public void StandAloneCodeUpgradeIsNotInterruptiple() { StandAloneCluster cluster = Utility.DoBaselineUpgrade("ClusterConfig.Windows.MultiMachine.June2018.V1.json"); Assert.AreEqual(SimpleClusterUpgradeTest.BaselineConfigVersion, cluster.Current.CSMConfig.Version.Version); Utility.UpdateStandAloneCluster("ClusterConfig.Windows.MultiMachine.June2018.V2.json", cluster, true); Assert.IsTrue(Utility.RunStateMachine(cluster)); ClusterUpgradeStateBase upgradeState = cluster.Pending; Assert.IsInstanceOfType(upgradeState, typeof(StandAloneSimpleClusterUpgradeState)); Assert.IsFalse(upgradeState.CanInterruptUpgrade()); }