From cb4adb2193a83413bc5545d89b7bbde4d6087761 Mon Sep 17 00:00:00 2001 From: Bernie Hackett Date: Fri, 14 Mar 2014 14:07:20 -0700 Subject: [PATCH] Fix large update tests. The server is less forgiving now. You can no longer update a document to larger than 16MB. --- test/test_bulk.py | 4 +--- test/test_collection.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_bulk.py b/test/test_bulk.py index 0d3f641ce..28255351c 100644 --- a/test/test_bulk.py +++ b/test/test_bulk.py @@ -584,10 +584,8 @@ class TestBulk(BulkTestBase): self.assertEqual(self.coll.find({'x': 2}).count(), 0) def test_upsert_large(self): - # We can insert a 16MB document, using an update command a little over - # 16MB long. client = self.coll.database.connection - big = 'a' * (client.max_bson_size - 30) + big = 'a' * (client.max_bson_size - 37) bulk = self.coll.initialize_ordered_bulk_op() bulk.find({'x': 1}).upsert().update({'$set': {'s': big}}) result = bulk.execute() diff --git a/test/test_collection.py b/test/test_collection.py index f19ab4447..b0d7709e2 100644 --- a/test/test_collection.py +++ b/test/test_collection.py @@ -1859,7 +1859,7 @@ class TestCollection(unittest.TestCase): self.assertRaises(DocumentTooLarge, self.db.test.update, {"bar": "x"}, {"bar": "x" * (max_size - 14)}, w=0) # This will pass with OP_UPDATE or the update command. - self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 15)}) + self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 32)}) def test_insert_large_batch(self): max_bson_size = self.client.max_bson_size