Skip to content

Instantly share code, notes, and snippets.

@bloodeagle40234
Last active April 7, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bloodeagle40234/213df5b2ee8567958fe745172d609875 to your computer and use it in GitHub Desktop.
Save bloodeagle40234/213df5b2ee8567958fe745172d609875 to your computer and use it in GitHub Desktop.
diff --git a/test/unit/common/test_db_replicator.py b/test/unit/common/test_db_replicator.py
index a1a18fe..e8c5d19 100644
--- a/test/unit/common/test_db_replicator.py
+++ b/test/unit/common/test_db_replicator.py
@@ -662,6 +662,12 @@ class TestDBReplicator(unittest.TestCase):
replicator._replicate_object('0', '/path/to/file',
replicator.ring.devs[3]['id'])
self.assertEqual(4, replicator._repl_to_node.call_count)
+ # even if it's the last handoff it works to keep 3 replicas
+ # 2 primaries + 1 handoff
+ replicator._repl_to_node = mock.Mock(side_effect=[DriveNotMounted()])
+ replicator._replicate_object('0', '/path/to/file',
+ replicator.ring.devs[-1]['id'])
+ self.assertEqual(4, replicator._repl_to_node.call_count)
# with two DriveNotMounted exceptions called on +2 more replica keeping
# durability
replicator._repl_to_node = mock.Mock(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment