Files
mongo/jstests/repl/repl12.js

51 lines
832 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) {
print("DEBUG:" + tojson(x));
2010-08-16 09:44:36 -07:00
}
rt = new ReplTest("repl12tests");
2010-08-16 09:44:36 -07:00
m = rt.start(true);
2010-08-16 09:44:36 -07:00
usedDBs = [];
2010-08-17 00:35:45 -04:00
a = "a";
for (i = 0; i < 3; ++i) {
usedDBs.push(a);
m.getDB(a).c.save({});
2010-08-16 09:44:36 -07:00
a += "a";
2010-08-17 00:29:17 -04:00
}
// print("\n\n\n DB NAMES MASTER:");
// printjson(m.getDBNames());
2010-08-17 00:29:17 -04:00
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
function countHave() {
2010-08-17 00:35:45 -04:00
var have = 0;
for (var i = 0; i < usedDBs.length; i++) {
if (s.getDB(usedDBs[i]).c.findOne())
2010-08-17 00:35:45 -04:00
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:29:17 -04:00
// printjson(s.getDBNames());