SLIDER-258. Jenkins build continue to hang on python unit tests

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

Branch: refs/heads/feature/SLIDER-375_slider-core_tests_failing_on_windows
Commit: 8bfd66e813635aa93a9551c121622b408d41b518
Parents: f292a16
Author: Sumit Mohanty <smoha...@hortonworks.com>
Authored: Thu Aug 28 15:37:31 2014 -0700
Committer: Sumit Mohanty <smoha...@hortonworks.com>
Committed: Thu Aug 28 15:37:31 2014 -0700

----------------------------------------------------------------------
 .../src/test/python/agent/TestRegistration.py         | 14 +-------------
 slider-agent/src/test/python/unitTests.py             |  1 +
 2 files changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8bfd66e8/slider-agent/src/test/python/agent/TestRegistration.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/test/python/agent/TestRegistration.py 
b/slider-agent/src/test/python/agent/TestRegistration.py
index f91fe29..7b3c875 100644
--- a/slider-agent/src/test/python/agent/TestRegistration.py
+++ b/slider-agent/src/test/python/agent/TestRegistration.py
@@ -37,15 +37,6 @@ class TestRegistration(TestCase):
     config = AgentConfig(tmpdir, ver_dir)
     config.set('agent', 'prefix', tmpdir)
     config.set('agent', 'current_ping_port', '33777')
-    try:
-      os.mkdir(ver_dir)
-    except OSError as exception:
-      if exception.errno != errno.EEXIST:
-        raise
-    pass
-    ver_file = os.path.join(ver_dir, "version")
-    with open(ver_file, "w") as text_file:
-      text_file.write("1.3.0")
 
     register = Register(config)
     data = register.build(State.INIT, State.INIT, {}, 1)
@@ -54,7 +45,7 @@ class TestRegistration(TestCase):
     self.assertEquals(data['publicHostname'] != "", True, "publicHostname 
should not be empty")
     self.assertEquals(data['responseId'], 1)
     self.assertEquals(data['timestamp'] > 1353678475465L, True, "timestamp 
should not be empty")
-    self.assertEquals(data['agentVersion'], '1.3.0', "agentVersion should not 
be empty")
+    self.assertEquals(data['agentVersion'], '1', "agentVersion should not be 
empty")
     self.assertEquals(data['actualState'], State.INIT, "actualState should not 
be empty")
     self.assertEquals(data['expectedState'], State.INIT, "expectedState should 
not be empty")
     self.assertEquals(data['allocatedPorts'], {}, "allocatedPorts should be 
empty")
@@ -66,8 +57,5 @@ class TestRegistration(TestCase):
     self.assertEquals(os.path.join(ver_dir, "."), 
config.getResolvedPath("log_dir"))
     self.assertEquals(os.path.join(ver_dir, "."), 
config.getResolvedPath("app_task_dir"))
 
-    os.remove(ver_file)
-    os.removedirs(ver_dir)
-
 if __name__ == "__main__":
   unittest.main()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8bfd66e8/slider-agent/src/test/python/unitTests.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/test/python/unitTests.py 
b/slider-agent/src/test/python/unitTests.py
index e3f2d7c..b01438e 100644
--- a/slider-agent/src/test/python/unitTests.py
+++ b/slider-agent/src/test/python/unitTests.py
@@ -56,6 +56,7 @@ def all_tests_suite():
       files_list += os.listdir(src_dir + os.sep + directory)
   ## temporarily deleting to add more predictability
   ## shuffle(files_list)
+  files_list.sort()
   tests_list = []
 
   logger.info('------------------------TESTS 
LIST:-------------------------------------')

Reply via email to