Exemple #1
0
        public void DisconnectTimedOutExecutorsTestSimpleScenario()
        {
            // add one that is OK
            ExecutorStorageView executor1 = new ExecutorStorageView(true, true, DateTime.Now, "hostname", 10, "username", 1, 1, 1, 1);
            // add one that is timed out
            ExecutorStorageView executor2 = new ExecutorStorageView(true, true, DateTime.Now.AddDays((-1)), "hostname", 10, "username", 1, 1, 1, 1);
            // add one that is not connected
            ExecutorStorageView executor3 = new ExecutorStorageView(false, false, DateTime.Now, "hostname", 10, "username", 1, 1, 1, 1);

            string executorId1 = _managerStorage.AddExecutor(executor1);
            string executorId2 = _managerStorage.AddExecutor(executor2);
            string executorId3 = _managerStorage.AddExecutor(executor3);

            // whatever was not responsive in the last 60 seconds should get lost
            TimeSpan timeSpan = new TimeSpan(0, 0, 60);

            //TODO: This is now moved to the "watchdog" class
            //need a seperate tester for that.
            //DisconnectTimedOutExecutors(timeSpan);
            Assert.Fail("DisconnectTimedOutExecutors(timeSpan) is moved to a seperate class now. Need a new test case.");

            // check what was disconnected
            Assert.IsTrue(_managerStorage.GetExecutor(executorId1).Connected);
            Assert.IsFalse(_managerStorage.GetExecutor(executorId2).Connected);
            Assert.IsFalse(_managerStorage.GetExecutor(executorId3).Connected);
        }
        public void DisconnectTimedOutExecutorsTestSimpleScenario()
        {
            // add one that is OK
            ExecutorStorageView executor1 = new ExecutorStorageView(true, true, DateTime.Now, "hostname", 10, "username", 1, 1, 1, 1);
            // add one that is timed out
            ExecutorStorageView executor2 = new ExecutorStorageView(true, true, DateTime.Now.AddDays((-1)), "hostname", 10, "username", 1, 1, 1, 1);
            // add one that is not connected
            ExecutorStorageView executor3 = new ExecutorStorageView(false, false, DateTime.Now, "hostname", 10, "username", 1, 1, 1, 1);

            String executorId1 = m_managerStorage.AddExecutor(executor1);
            String executorId2 = m_managerStorage.AddExecutor(executor2);
            String executorId3 = m_managerStorage.AddExecutor(executor3);

            // whatever was not responsive in the last 60 seconds should get lost
            TimeSpan timeSpan = new TimeSpan(0, 0, 60);

            DisconnectTimedOutExecutors(timeSpan);

            // check what was disconnected

            Assert.IsTrue(m_managerStorage.GetExecutor(executorId1).Connected);
            Assert.IsFalse(m_managerStorage.GetExecutor(executorId2).Connected);
            Assert.IsFalse(m_managerStorage.GetExecutor(executorId3).Connected);
        }