From f0d60f2396aa57210aaddf5b208d0d4ab047aded Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 4 Jan 2010 10:50:36 -0800 Subject: SERVER-519 adding test --- jstests/fsync.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'jstests/fsync.js') diff --git a/jstests/fsync.js b/jstests/fsync.js index 4097bc65f10..1ea86f5d1f3 100644 --- a/jstests/fsync.js +++ b/jstests/fsync.js @@ -1,5 +1,9 @@ // test the lock/unlock snapshotting feature a bit +debug = function( t ) { + print( t ); +} + x=db.runCommand({fsync:1,lock:1}); assert(!x.ok,"D"); @@ -12,11 +16,22 @@ assert(x.ok,"C"); y = d.currentOp(); assert(y.fsyncLock,"B"); +debug( "current op ok" ); + +printjson( db.foo.find().toArray() ); +db.foo.insert({x:2}); + +debug( "done insert attempt" ); + z = d.runCommand({unlock:1}); +debug( "sent unlock" ); + // it will take some time to unlock, and unlock does not block and wait for that // doing a write will make us wait until db is writeable. db.foo.insert({x:1}); +debug( "done insert" ); + assert( d.currentOp().fsyncLock == null, "A" ); -- cgit v1.2.1