Repository: incubator-slider
Updated Branches:
  refs/heads/develop c0a320db2 -> d2ef8cced


SLIDER-438 Slider agent continues to run in the container on a node where NM 
dies


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/d2ef8cce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/d2ef8cce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/d2ef8cce

Branch: refs/heads/develop
Commit: d2ef8cced950bedfdc5ed6e521257046818240b9
Parents: c0a320d
Author: Gour Saha <[email protected]>
Authored: Wed Oct 15 14:43:20 2014 -0700
Committer: Gour Saha <[email protected]>
Committed: Wed Oct 15 14:43:20 2014 -0700

----------------------------------------------------------------------
 slider-agent/src/main/python/agent/Controller.py    |  1 -
 .../src/test/python/agent/TestController.py         | 16 ++++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d2ef8cce/slider-agent/src/main/python/agent/Controller.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/Controller.py 
b/slider-agent/src/main/python/agent/Controller.py
index 39320fa..93390eb 100644
--- a/slider-agent/src/main/python/agent/Controller.py
+++ b/slider-agent/src/main/python/agent/Controller.py
@@ -280,7 +280,6 @@ class Controller(threading.Thread):
           terminateAgent = response['terminateAgent']
           if terminateAgent:
             logger.error("Got terminateAgent command")
-            self.terminateAgent = True
             self.stopApp()
             # Continue will add some wait time
             continue

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d2ef8cce/slider-agent/src/test/python/agent/TestController.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/test/python/agent/TestController.py 
b/slider-agent/src/test/python/agent/TestController.py
index 02b0d0e..bda8033 100644
--- a/slider-agent/src/test/python/agent/TestController.py
+++ b/slider-agent/src/test/python/agent/TestController.py
@@ -388,7 +388,7 @@ class TestController(unittest.TestCase):
     self.assertEqual(1, self.controller.DEBUG_SUCCESSFULL_HEARTBEATS)
 
     # retry registration
-    response["registrationCommand"] = "true"
+    response["registrationCommand"] = {"command": "register"}
     sendRequest.side_effect = one_heartbeat
     self.controller.DEBUG_STOP_HEARTBEATING = False
     self.controller.heartbeatWithServer()
@@ -396,7 +396,7 @@ class TestController(unittest.TestCase):
     self.assertTrue(self.controller.repeatRegistration)
 
     # components are not mapped
-    response["registrationCommand"] = "false"
+    response["registrationCommand"] = {"command": "register"}
     response["hasMappedComponents"] = False
     sendRequest.side_effect = one_heartbeat
     self.controller.DEBUG_STOP_HEARTBEATING = False
@@ -421,7 +421,7 @@ class TestController(unittest.TestCase):
     self.assertTrue(self.controller.hasMappedComponents)
 
     # wrong responseId => restart
-    response = {"responseId":"2", "restartAgent":"false"}
+    response = {"responseId":"2", "restartAgent": False}
     loadsMock.return_value = response
 
     restartAgent = MagicMock(name="restartAgent")
@@ -447,7 +447,7 @@ class TestController(unittest.TestCase):
 
     # just status command when state = STARTED
     self.controller.responseId = 1
-    response = {"responseId":"2", "restartAgent":"false"}
+    response = {"responseId":"2", "restartAgent": False}
     loadsMock.return_value = response
     addToQueue = MagicMock(name="addToQueue")
     self.controller.addToQueue = addToQueue
@@ -461,7 +461,7 @@ class TestController(unittest.TestCase):
 
     # just status command when state = FAILED
     self.controller.responseId = 1
-    response = {"responseId":"2", "restartAgent":"false"}
+    response = {"responseId":"2", "restartAgent": False}
     loadsMock.return_value = response
     addToQueue = MagicMock(name="addToQueue")
     self.controller.addToQueue = addToQueue
@@ -475,7 +475,7 @@ class TestController(unittest.TestCase):
 
     # no status command when state = STARTING
     self.controller.responseId = 1
-    response = {"responseId":"2", "restartAgent":"false"}
+    response = {"responseId":"2", "restartAgent": False}
     loadsMock.return_value = response
     addToQueue = MagicMock(name="addToQueue")
     self.controller.addToQueue = addToQueue
@@ -497,7 +497,7 @@ class TestController(unittest.TestCase):
     # restartAgent command
     self.controller.responseId = 1
     self.controller.DEBUG_STOP_HEARTBEATING = False
-    response["restartAgent"] = "true"
+    response["restartAgent"] = True
     restartAgent = MagicMock(name="restartAgent")
     self.controller.restartAgent = restartAgent
     self.controller.heartbeatWithServer()
@@ -508,7 +508,7 @@ class TestController(unittest.TestCase):
     self.controller.responseId = 1
     self.controller.DEBUG_STOP_HEARTBEATING = False
     actionQueue.isIdle.return_value = False
-    response["restartAgent"] = "false"
+    response["restartAgent"] = False
     self.controller.heartbeatWithServer()
 
     sleepMock.assert_called_with(

Reply via email to