Merge "Fix timing test error when rebalancing" into stable/newton

This commit is contained in:
Jenkins 2017-04-04 00:55:28 +00:00 committed by Gerrit Code Review
commit 77c193aedb
1 changed files with 1 additions and 1 deletions

View File

@ -1888,9 +1888,9 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
def test_time_remaining(self):
self.create_sample_ring()
self.run_srb('rebalance')
now = time.time()
with mock.patch('swift.common.ring.builder.time', return_value=now):
self.run_srb('rebalance')
out, err = self.run_srb('rebalance')
self.assertIn('No partitions could be reassigned', out)
self.assertIn('must be at least min_part_hours', out)