summaryrefslogtreecommitdiff
path: root/jstests/disk/quota2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/disk/quota2.js')
-rw-r--r--jstests/disk/quota2.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/jstests/disk/quota2.js b/jstests/disk/quota2.js
index cdeda1a2a23..a5f07abec8a 100644
--- a/jstests/disk/quota2.js
+++ b/jstests/disk/quota2.js
@@ -13,12 +13,12 @@ db = m.getDB( baseName );
big = new Array( 10000 ).toString();
// Insert documents until quota is exhausted.
-var coll = db[ baseName ];
-var res = coll.insert({ b: big });
-while( !res.hasWriteError() ) {
- res = coll.insert({ b: big });
+while( !db.getLastError() ) {
+ db[ baseName ].save( {b:big} );
}
+db.resetError();
+
// Trigger allocation of an additional file for a 'special' namespace.
for( n = 0; !db.getLastError(); ++n ) {
db.createCollection( '' + n );
@@ -27,10 +27,10 @@ for( n = 0; !db.getLastError(); ++n ) {
// Check that new docs are saved in the .0 file.
for( i = 0; i < n; ++i ) {
c = db[ ''+i ];
- res = c.insert({ b: big });
- if( !res.hasWriteError() ) {
- assert.eq( 0, c.find()._addSpecial( "$showDiskLoc", true )[ 0 ].$diskLoc.file );
+ c.save( {b:big} );
+ if( !db.getLastError() ) {
+ assert.eq( 0, c.find()._addSpecial( "$showDiskLoc", true )[ 0 ].$diskLoc.file );
}
}
-}
+} \ No newline at end of file