summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMathias Stearn <redbeard0531@gmail.com>2015-07-28 08:55:55 -0400
committerMathias Stearn <redbeard0531@gmail.com>2015-07-28 08:55:55 -0400
commit1800d67e551de19d27cc7a477793c3ed32be9285 (patch)
tree4143f6760b27074b5629161cd69f9816eba3c2f1 /jstests
parent0733ab9c06cabbd9d5d07f68d94714bfb0b2e913 (diff)
downloadmongo-1800d67e551de19d27cc7a477793c3ed32be9285.tar.gz
SERVER-19559 fix test to use GLE rather than assert.writeOK/Error
Diffstat (limited to 'jstests')
-rw-r--r--jstests/noPassthroughWithMongod/update_26only_server19559.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/jstests/noPassthroughWithMongod/update_26only_server19559.js b/jstests/noPassthroughWithMongod/update_26only_server19559.js
index 040c3fb4eb8..6983ca8cdf3 100644
--- a/jstests/noPassthroughWithMongod/update_26only_server19559.js
+++ b/jstests/noPassthroughWithMongod/update_26only_server19559.js
@@ -19,7 +19,8 @@ function assertCountEq(count) {
db.adminCommand({setParameter:1, failIndexKeyTooLong:false});
var bigStrX = new Array(1024).join('x');
var bigStrY = new Array(1024).join('y'); // same size as bigStrX
-assert.writeOK(t.insert({_id : 1, data: bigStrX}));
+t.insert({_id : 1, data: bigStrX});
+assert.gleSuccess(db);
assertCountEq(1);
var origLoc = getDiskLoc();
db.adminCommand({setParameter:1, failIndexKeyTooLong:true});
@@ -27,21 +28,25 @@ db.adminCommand({setParameter:1, failIndexKeyTooLong:true});
// update to document needing move will fail when it tries to index oversized field. Ensure that it
// fully reverts to the original state.
var biggerStr = new Array(4096).join('y');
-assert.writeError(t.update({_id:1}, {$set: {data: biggerStr}}));
+t.update({_id:1}, {$set: {data: biggerStr}});
+assert.gleError(db);
assert.eq(getDiskLoc(), origLoc);
assertCountEq(1);
// non-moving update that will fail
-assert.writeError(t.update({_id:1}, {$set: {otherField:1, data:bigStrY}}));
+t.update({_id:1}, {$set: {otherField:1, data:bigStrY}});
+assert.gleError(db);
assert.eq(getDiskLoc(), origLoc);
assertCountEq(1);
// moving update that will succeed since not changing indexed fields.
-assert.writeOK(t.update({_id:1}, {$set: {otherField:1, notIndexed:bigStrY}}));
+t.update({_id:1}, {$set: {otherField:1, notIndexed:bigStrY}});
+assert.gleSuccess(db);
assert(!friendlyEqual(getDiskLoc(), origLoc));
assertCountEq(1);
// remove and assert there are no orphan entries.
-assert.writeOK(t.remove({}));
+t.remove({});
+assert.gleSuccess(db);
assertCountEq(0);
})();