Files
mongo/jstests/repl/repl7.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2009-03-31 14:05:20 -04:00
// Test persistence of list of dbs to add.
var getDBNamesNoThrow = function(conn) {
try {
return conn.getDBNames();
} catch (e) {
printjson(e);
return [""];
}
}
doTest = function(signal, extraOpts) {
2009-04-01 18:21:07 -04:00
rt = new ReplTest( "repl7tests" );
2009-03-31 14:05:20 -04:00
m = rt.start( true );
2009-03-31 14:05:20 -04:00
for( n = "a"; n != "aaaaa"; n += "a" ) {
m.getDB( n ).a.save( {x:1} );
}
s = rt.start(false, extraOpts);
2009-03-31 14:05:20 -04:00
assert.soon( function() {
return -1 != getDBNamesNoThrow(s).indexOf( "aa" );
2009-05-19 13:43:32 -04:00
}, "aa timeout", 60000, 1000 );
2009-03-31 14:05:20 -04:00
rt.stop( false, signal );
s = rt.start(false, extraOpts, signal);
2009-03-31 14:05:20 -04:00
assert.soon( function() {
for( n = "a"; n != "aaaaa"; n += "a" ) {
if ( -1 == getDBNamesNoThrow(s).indexOf( n ) )
2009-03-31 14:05:20 -04:00
return false;
}
return true;
2009-05-19 13:43:32 -04:00
}, "a-aaaa timeout", 60000, 1000 );
2009-03-31 14:05:20 -04:00
2009-05-19 13:43:32 -04:00
assert.soon( function() {
for( n = "a"; n != "aaaaa"; n += "a" ) {
if ( 1 != m.getDB( n ).a.find().count() ) {
return false;
}
}
return true; }, "a-aaaa count timeout" );
sleep( 300 );
rt.stop();
2009-03-31 14:05:20 -04:00
}
doTest( 15 ); // SIGTERM
doTest(9, { journal: null }); // SIGKILL