From 1800d67e551de19d27cc7a477793c3ed32be9285 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 28 Jul 2015 08:55:55 -0400 Subject: SERVER-19559 fix test to use GLE rather than assert.writeOK/Error --- .../noPassthroughWithMongod/update_26only_server19559.js | 15 ++++++++++----- 1 file 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); })(); -- cgit v1.2.1