ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-9675. Some rarely reproducible python tests failures (aonishuk)
Date Tue, 17 Feb 2015 15:04:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d7f51aa40 -> 382cf5828


AMBARI-9675. Some rarely reproducible python tests failures (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/382cf582
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/382cf582
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/382cf582

Branch: refs/heads/trunk
Commit: 382cf5828c2fe35c4ffef85d2c321fd1059780dc
Parents: d7f51aa
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Feb 17 17:04:30 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Feb 17 17:04:30 2015 +0200

----------------------------------------------------------------------
 .../src/test/python/resource_management/TestExecuteResource.py  | 2 +-
 .../src/test/python/custom_actions/TestInstallPackages.py       | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/382cf582/ambari-agent/src/test/python/resource_management/TestExecuteResource.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestExecuteResource.py b/ambari-agent/src/test/python/resource_management/TestExecuteResource.py
index 5013bad..d9f1a60 100644
--- a/ambari-agent/src/test/python/resource_management/TestExecuteResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestExecuteResource.py
@@ -115,7 +115,7 @@ class TestExecuteResource(TestCase):
       )
     pass
 
-    time_mock.assert_called_once_with(10)
+    self.assertTrue(call(10) in time_mock.call_args_list)
 
   @patch.object(pwd, "getpwnam")
   def test_attribute_group(self, getpwnam_mock):

http://git-wip-us.apache.org/repos/asf/ambari/blob/382cf582/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
index ad164e7..fa2ea6b 100644
--- a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
+++ b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
@@ -19,7 +19,9 @@ limitations under the License.
 '''
 import json
 import os
+import pty
 import socket
+import subprocess
 from resource_management import Script,ConfigDictionary
 from mock.mock import patch
 from mock.mock import MagicMock
@@ -31,6 +33,9 @@ from resource_management.core.resources.packaging import Package
 from resource_management.core.exceptions import Fail
 from ambari_commons.os_check import OSCheck
 
+@patch.object(pty, "openpty", new = MagicMock(return_value=(1,5)))
+@patch.object(os, "close", new=MagicMock())
+@patch.object(subprocess, "Popen", new=MagicMock())
 class TestInstallPackages(RMFTestCase):
 
   @staticmethod


Mime
View raw message