0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

try to add more debugging to snapshot2.js.\

This commit is contained in:
Dwight 2010-08-26 10:07:13 -04:00
parent 251d1b2a80
commit b7e0bd448d

View File

@ -24,9 +24,18 @@ big = new Array( 2000 ).toString(); // overflow oplog, so test can't pass suprio
rp.slave().setSlaveOk();
print("snapshot2.js 5 -----------------------------------------------------------");
for (i = 0; i < 500; ++i) {
rp.master().getDB( baseName )[ baseName ].save( { _id: new ObjectId(), i: i, b: big } );
if ( i % 250 == 249 ) {
assert.soon( function() { return i+1 == rp.slave().getDB( baseName )[ baseName ].count(); } );
rp.master().getDB( baseName )[ baseName ].save( { _id: new ObjectId(), i: i, b: big } );
if (i % 250 == 249) {
function p() { return i + 1 == rp.slave().getDB(baseName)[baseName].count(); }
try {
assert.soon(p);
} catch (e) {
print("\n\n\nsnapshot2.js\ni+1:" + (i + 1));
print("slave count:" + rp.slave().getDB(baseName)[baseName].count());
sleep(2000);
print(p());
throw (e);
}
sleep( 10 ); // give master a chance to grab a sync point - have such small oplogs the master log might overflow otherwise
}
}