Skip to content

Commit cb4adb2

Browse files
committed
Fix large update tests.
The server is less forgiving now. You can no longer update a document to larger than 16MB.
1 parent f1264cc commit cb4adb2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

test/test_bulk.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,8 @@ def test_upsert(self):
584584
self.assertEqual(self.coll.find({'x': 2}).count(), 0)
585585

586586
def test_upsert_large(self):
587-
# We can insert a 16MB document, using an update command a little over
588-
# 16MB long.
589587
client = self.coll.database.connection
590-
big = 'a' * (client.max_bson_size - 30)
588+
big = 'a' * (client.max_bson_size - 37)
591589
bulk = self.coll.initialize_ordered_bulk_op()
592590
bulk.find({'x': 1}).upsert().update({'$set': {'s': big}})
593591
result = bulk.execute()

test/test_collection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ def test_insert_large_document(self):
18591859
self.assertRaises(DocumentTooLarge, self.db.test.update,
18601860
{"bar": "x"}, {"bar": "x" * (max_size - 14)}, w=0)
18611861
# This will pass with OP_UPDATE or the update command.
1862-
self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 15)})
1862+
self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 32)})
18631863

18641864
def test_insert_large_batch(self):
18651865
max_bson_size = self.client.max_bson_size

0 commit comments

Comments
 (0)