Skip to content

Commit b85beec

Browse files
committed
test_lazy_connect_w0 can break the next test.
1 parent 596645b commit b85beec

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/test_client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,19 @@ def test_kill_cursors(self):
691691
list(cursor)
692692

693693
def test_lazy_connect_w0(self):
694+
# Ensure that connect-on-demand works when the first operation is
695+
# an unacknowledged write. This exercises _writable_max_wire_version().
696+
697+
# Use a separate collection to avoid races where we're still
698+
# completing an operation on a collection while the next test begins.
694699
client = rs_or_single_client(connect=False)
695-
client.pymongo_test.test.insert({}, w=0)
700+
client.test_lazy_connect_w0.test.insert({}, w=0)
696701

697702
client = rs_or_single_client(connect=False)
698-
client.pymongo_test.test.update({}, {'$set': {'x': 1}}, w=0)
703+
client.test_lazy_connect_w0.test.update({}, {'$set': {'x': 1}}, w=0)
699704

700705
client = rs_or_single_client(connect=False)
701-
client.pymongo_test.test.remove(w=0)
706+
client.test_lazy_connect_w0.test.remove(w=0)
702707

703708
@client_context.require_no_mongos
704709
def test_exhaust_network_error(self):

0 commit comments

Comments
 (0)