summaryrefslogtreecommitdiff
path: root/jstests/fsync.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/fsync.js')
-rw-r--r--jstests/fsync.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/jstests/fsync.js b/jstests/fsync.js
index fccd623..134d558 100644
--- a/jstests/fsync.js
+++ b/jstests/fsync.js
@@ -1,22 +1,21 @@
// test the lock/unlock snapshotting feature a bit
-x=db.runCommand({fsync:1,lock:1});
+x=db.runCommand({fsync:1,lock:1}); // not on admin db
assert(!x.ok,"D");
-d=db.getSisterDB("admin");
-
-x=d.runCommand({fsync:1,lock:1});
+x=db.fsyncLock(); // uses admin automatically
assert(x.ok,"C");
-y = d.currentOp();
+y = db.currentOp();
assert(y.fsyncLock,"B");
-z = d.$cmd.sys.unlock.findOne();
+z = db.fsyncUnlock();
+assert( db.currentOp().fsyncLock == null, "A2" );
-// 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.
+// make sure the db is unlocked
db.jstests_fsync.insert({x:1});
+db.getLastError();
-assert( d.currentOp().fsyncLock == null, "A" );
+assert( db.currentOp().fsyncLock == null, "A" );