aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Fixing broken test.
Date Mon, 15 Sep 2014 23:03:40 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 49f424be6 -> 78c8dcc39


Fixing broken test.

Reviewed at https://reviews.apache.org/r/25673/


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

Branch: refs/heads/master
Commit: 78c8dcc39648a9da8a3f3802d7eaccb6bd481899
Parents: 49f424b
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Mon Sep 15 16:03:16 2014 -0700
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Mon Sep 15 16:03:16 2014 -0700

----------------------------------------------------------------------
 .../aurora/client/commands/test_maintenance.py  | 21 ++++----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/78c8dcc3/src/test/python/apache/aurora/client/commands/test_maintenance.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_maintenance.py b/src/test/python/apache/aurora/client/commands/test_maintenance.py
index 2151f02..004033b 100644
--- a/src/test/python/apache/aurora/client/commands/test_maintenance.py
+++ b/src/test/python/apache/aurora/client/commands/test_maintenance.py
@@ -134,19 +134,15 @@ class TestMaintenanceCommands(AuroraClientCommandTest):
     ])
 
     with contextlib.nested(
-        patch('time.sleep'),
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.api.sla.Sla.get_domain_uptime_vector',
               return_value=mock_vector),
         patch('apache.aurora.client.commands.maintenance.CLUSTERS', new=self.TEST_CLUSTERS),
         patch('apache.aurora.client.commands.maintenance.parse_script', return_value=mock_callback),
-        patch('twitter.common.app.get_options', return_value=mock_options)) as (
-            mock_sleep, _, _, _, _, _):
+        patch('twitter.common.app.get_options', return_value=mock_options)):
       host_drain([self.TEST_CLUSTER])
 
       mock_scheduler_proxy.startMaintenance.assert_called_with(Hosts(set(self.HOSTNAMES)))
-      #TODO(jsmith): Consider not mocking out sleep and instead refactoring
-      assert mock_sleep.call_count == 3
       assert mock_scheduler_proxy.maintenanceStatus.call_count == 3
       assert mock_scheduler_proxy.drainHosts.call_count == 3
       assert mock_callback.call_count == 3
@@ -173,17 +169,14 @@ class TestMaintenanceCommands(AuroraClientCommandTest):
     ])
 
     with contextlib.nested(
-        patch('time.sleep'),
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.api.sla.Sla.get_domain_uptime_vector',
               return_value=mock_vector),
         patch('apache.aurora.client.commands.maintenance.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('twitter.common.app.get_options', return_value=mock_options)) as (
-            mock_sleep, _, _, _, _):
+        patch('twitter.common.app.get_options', return_value=mock_options)):
       host_drain([self.TEST_CLUSTER])
 
       mock_scheduler_proxy.startMaintenance.assert_called_with(Hosts(set(self.HOSTNAMES)))
-      assert mock_sleep.call_count == 2
       assert mock_scheduler_proxy.maintenanceStatus.call_count == 2
       assert mock_scheduler_proxy.drainHosts.call_count == 2
 
@@ -204,7 +197,6 @@ class TestMaintenanceCommands(AuroraClientCommandTest):
       ])
 
       with contextlib.nested(
-          patch('time.sleep'),
           patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
           patch('apache.aurora.client.api.sla.Sla.get_domain_uptime_vector',
                 return_value=mock_vector),
@@ -234,14 +226,12 @@ class TestMaintenanceCommands(AuroraClientCommandTest):
       ])
 
       with contextlib.nested(
-          patch('time.sleep'),
           patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
           patch('apache.aurora.client.api.sla.Sla.get_domain_uptime_vector',
                 return_value=mock_vector),
           patch('apache.aurora.client.commands.maintenance.CLUSTERS', new=self.TEST_CLUSTERS),
           patch('apache.aurora.admin.admin_util.log_admin_message'),
-          patch('twitter.common.app.get_options', return_value=mock_options)) as (
-              _, _, _, _, log, _):
+          patch('twitter.common.app.get_options', return_value=mock_options)) as (_, _, _,
log, _):
         host_drain([self.TEST_CLUSTER])
 
         assert 'Test overrides' in log.call_args[0][1]
@@ -268,18 +258,15 @@ class TestMaintenanceCommands(AuroraClientCommandTest):
       return mock_vector
 
     with contextlib.nested(
-        patch('time.sleep'),
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.api.sla.Sla.get_domain_uptime_vector',
               return_value=create_empty_sla_results()),
         patch('apache.aurora.client.commands.maintenance.CLUSTERS', new=self.TEST_CLUSTERS),
-        patch('twitter.common.app.get_options', return_value=mock_options)) as (
-            mock_sleep, _, _, _, _):
+        patch('twitter.common.app.get_options', return_value=mock_options)):
 
       host_drain([self.TEST_CLUSTER])
 
       mock_scheduler_proxy.startMaintenance.assert_called_with(Hosts(set(self.HOSTNAMES)))
-      assert mock_sleep.call_count == 3
       assert mock_scheduler_proxy.maintenanceStatus.call_count == 3
       assert mock_scheduler_proxy.drainHosts.call_count == 3
 


Mime
View raw message