Files
mongo/jstests/fsync.js

22 lines
445 B
JavaScript
Raw Normal View History

2010-01-02 11:31:38 -05:00
// test the lock/unlock snapshotting feature a bit
x=db.runCommand({fsync:1,lock:1}); // not on admin db
2010-01-02 11:31:38 -05:00
assert(!x.ok,"D");
x=db.fsyncLock(); // uses admin automatically
2010-01-02 11:31:38 -05:00
assert(x.ok,"C");
y = db.currentOp();
2010-01-02 11:31:38 -05:00
assert(y.fsyncLock,"B");
z = db.fsyncUnlock();
assert( db.currentOp().fsyncLock == null, "A2" );
2010-01-02 11:31:38 -05:00
// make sure the db is unlocked
db.jstests_fsync.insert({x:1});
db.getLastError();
2010-01-02 11:31:38 -05:00
assert( db.currentOp().fsyncLock == null, "A" );
2010-01-02 11:31:38 -05:00