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
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
function debug(x) {
|
|
|
|
|
print("DEBUG:" + tojson(x));
|
2010-08-16 09:44:36 -07:00
|
|
|
}
|
|
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
rt = new ReplTest("repl12tests");
|
2010-08-16 09:44:36 -07:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
m = rt.start(true);
|
2010-08-16 09:44:36 -07:00
|
|
|
|
2016-02-04 12:30:30 -05:00
|
|
|
usedDBs = [];
|
2010-08-17 00:35:45 -04:00
|
|
|
|
2016-02-04 12:30:30 -05:00
|
|
|
a = "a";
|
2016-03-09 12:17:50 -05:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2016-03-09 12:17:50 -05: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
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
function countHave() {
|
2010-08-17 00:35:45 -04:00
|
|
|
var have = 0;
|
2016-03-09 12:17:50 -05:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.soon(function() {
|
|
|
|
|
try {
|
|
|
|
|
var c = countHave();
|
|
|
|
|
debug("count: " + c);
|
|
|
|
|
return c == 3;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
printjson(e);
|
|
|
|
|
return false;
|
2013-01-22 14:47:25 -05:00
|
|
|
}
|
2016-03-09 12:17:50 -05:00
|
|
|
});
|
2010-08-17 00:29:17 -04:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
// printjson(s.getDBNames());
|