function debug( msg ) { print( "fsync2: " + msg ); } var loops = 200; if ( db.getSisterDB("local").slaves.count() > 0 ) { // replication can cause some write locks on local // therefore this test is flaky with replication on loops = 1; } function doTest() { db.fsync2.drop(); // Make write ops asynchronous so the test won't hang when in fsync lock mode. db.getMongo().forceWriteMode('legacy'); db.fsync2.save( {x:1} ); d = db.getSisterDB( "admin" ); assert.commandWorked( d.runCommand( {fsync:1, lock: 1 } ) ); debug( "after lock" ); for ( var i=0; i