Files
mongo/jstests/repl/repl12.js

53 lines
889 B
JavaScript
Raw Normal View History

2010-08-16 09:44:36 -07:00
// SERVER-1626
2010-08-16 15:29:40 -04:00
// check for initial sync of multiple db's
2010-08-16 09:44:36 -07:00
function debug( x ) {
2010-08-17 00:29:17 -04:00
print( "DEBUG:" + tojson( x ) );
2010-08-16 09:44:36 -07:00
}
rt = new ReplTest( "repl12tests" );
m = rt.start( true );
2010-08-17 00:35:45 -04:00
usedDBs = []
2010-08-16 09:44:36 -07:00
a = "a"
for( i = 0; i < 3; ++i ) {
2010-08-17 00:35:45 -04:00
usedDBs.push( a )
2010-08-16 09:44:36 -07:00
m.getDB( a ).c.save( {} );
a += "a";
2010-08-17 00:29:17 -04:00
}
//print("\n\n\n DB NAMES MASTER:");
//printjson(m.getDBNames());
var z = 10500;
print("sleeping " + z + "ms");
sleep(z);
2010-08-16 15:29:40 -04:00
s = rt.start(false);
2010-08-16 09:44:36 -07:00
2010-08-17 00:35:45 -04:00
function countHave(){
var have = 0;
for ( var i=0; i<usedDBs.length; i++ ){
if ( s.getDB( usedDBs[i] ).c.findOne() )
have++;
}
return have;
}
assert.soon(
function() {
try {
var c = countHave();
debug( "count: " + c );
return c == 3;
} catch (e) {
printjson(e);
return false;
}
}
2010-08-17 00:35:45 -04:00
);
2010-08-17 00:29:17 -04:00
//printjson(s.getDBNames());