コード例 #1
0
        public void TestFailedNodeDuringTaskSubmittingThenFail()
        {
            var systemState = new SystemStateMachine();

            systemState.MoveNext(SystemStateEvent.AllContextsAreReady);
            Assert.True(systemState.MoveNext(SystemStateEvent.FailedNode).Equals(SystemState.ShuttingDown), "Fail to move from SubmittingTasks state to ShuttingDown state.");
            Assert.True(systemState.MoveNext(SystemStateEvent.NotRecoverable).Equals(SystemState.Fail), "Fail to move from ShuttingDown state to Fail state.");
        }
コード例 #2
0
        public void TestFailedNodeDuringTaskSubmittingThenRecovery()
        {
            var systemState = new SystemStateMachine();

            systemState.MoveNext(SystemStateEvent.AllContextsAreReady);
            Assert.True(systemState.MoveNext(SystemStateEvent.FailedNode).Equals(SystemState.ShuttingDown), "Fail to move from SubmittingTasks state to ShuttingDown state.");
            Assert.True(systemState.MoveNext(SystemStateEvent.Recover).Equals(SystemState.WaitingForEvaluator), "Fail to move from ShuttingDown state to WaitingForEvaluator state.");
        }
コード例 #3
0
        public void TestFromRequestEvaluatorToTasksComplete()
        {
            var systemState = new SystemStateMachine();

            Assert.True(systemState.CurrentState.Equals(SystemState.WaitingForEvaluator), "The initial state should be WaitingForEvaluator.");
            Assert.True(systemState.MoveNext(SystemStateEvent.FailedNode).Equals(SystemState.WaitingForEvaluator), "Fail to stay at WaitingForEvaluator state.");
            Assert.True(systemState.MoveNext(SystemStateEvent.AllContextsAreReady).Equals(SystemState.SubmittingTasks), "Fail to move from WaitingForEvaluator state to SubmittingTasks state.");
            Assert.True(systemState.MoveNext(SystemStateEvent.AllTasksAreRunning).Equals(SystemState.TasksRunning), "Fail to move from SubmittingTasks state to TasksRunning state.");
            Assert.True(systemState.MoveNext(SystemStateEvent.AllTasksAreCompleted).Equals(SystemState.TasksCompleted), "Fail to move from TasksRunning state to TasksCompleted state.");
        }
コード例 #4
0
ファイル: IMRUDriver.cs プロジェクト: InsightsDev-dev/reef
 /// <summary>
 /// Called from ActiveContextManager when all the expected active context are received.
 /// It changes the system state then calls SubmitTasks().
 /// </summary>
 /// <param name="value"></param>
 public void OnNext(IEnumerable <IActiveContext> value)
 {
     Logger.Log(Level.Info, "Received event from ActiveContextManager with NumberOfActiveContexts:" + (value != null ? value.Count() : 0));
     lock (_lock)
     {
         // When the event AllContextsAreReady happens, change the system state from WaitingForEvaluator to SubmittingTasks
         _systemState.MoveNext(SystemStateEvent.AllContextsAreReady);
         SubmitTasks(value);
     }
 }
コード例 #5
0
        public void TestNoRecoverableFailedEvaluatorDuringWaitingForEvaluator()
        {
            var systemState = new SystemStateMachine();

            Assert.True(systemState.MoveNext(SystemStateEvent.NotRecoverable).Equals(SystemState.Fail), "Fail to move from WaitingForEvaluator state to Fail state.");
        }