summaryrefslogtreecommitdiff
path: root/jstests/fsync.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-01-04 10:50:36 -0800
committerAaron <aaron@10gen.com>2010-01-04 10:50:36 -0800
commitf0d60f2396aa57210aaddf5b208d0d4ab047aded (patch)
tree27aa1f5137f3370dc5efcf16253fe55759ad91dd /jstests/fsync.js
parenta0f882dae0a477f8c3ed1c75daa6bf84cab83cc8 (diff)
downloadmongo-f0d60f2396aa57210aaddf5b208d0d4ab047aded.tar.gz
SERVER-519 adding test
Diffstat (limited to 'jstests/fsync.js')
-rw-r--r--jstests/fsync.js15
1 files changed, 15 insertions, 0 deletions
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" );