diff --git a/test/replica/replset_tools.py b/test/replica/replset_tools.py
index <HASH>..<HASH> 100644
--- a/test/replica/replset_tools.py
+++ b/test/replica/replset_tools.py
@@ -199,7 +199,11 @@ def stepdown_primary():
     primary = get_primary()
     if primary:
         c = pymongo.Connection(primary)
-        c.admin.command('replSetStepDown', 20)
+        # replSetStepDown causes mongod to close all connections
+        try:
+            c.admin.command('replSetStepDown', 20)
+        except:
+            pass
 
 
 def restart_members(members):
diff --git a/test/replica/test_replica_set.py b/test/replica/test_replica_set.py
index <HASH>..<HASH> 100644
--- a/test/replica/test_replica_set.py
+++ b/test/replica/test_replica_set.py
@@ -160,7 +160,7 @@ class TestHealthMonitor(unittest.TestCase):
         secondaries = c.secondaries
 
         def primary_changed():
-            for _ in xrange(20):
+            for _ in xrange(30):
                 if c.primary != primary:
                     return True
                 time.sleep(1)
Make stepdown test work with MongoDB-<I>.

MongoDB-<I> wasn't closing connections during
primary stepdown. That was fixed in <I>.