Skip to content

Commit bd05bb2

Browse files
committed
make replication tests more reliable
1 parent d1f7eee commit bd05bb2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/mongo/dbtests/replsettests.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace ReplSetTests {
124124
public:
125125
Base() {
126126
cmdLine._replSet = "foo";
127-
cmdLine.oplogSize = 5;
127+
cmdLine.oplogSize = 5 * 1024 * 1024;
128128
createOplog();
129129
setup();
130130
}
@@ -291,6 +291,8 @@ namespace ReplSetTests {
291291

292292
dropDB->stopIndexBuilds(dbname, cmdObj);
293293

294+
sleepsecs(1);
295+
294296
ASSERT(t1.finished());
295297
ASSERT(t2.finished());
296298
ASSERT(!t3.finished());
@@ -335,6 +337,8 @@ namespace ReplSetTests {
335337
BSONObj cmdObj = BSON("drop" << coll);
336338
drop->stopIndexBuilds(dbname, cmdObj);
337339

340+
sleepsecs(1);
341+
338342
ASSERT(t1.finished());
339343
ASSERT(t2.finished());
340344
ASSERT(!t3.finished());
@@ -372,6 +376,8 @@ namespace ReplSetTests {
372376

373377
c->stopIndexBuilds(dbname, cmd1);
374378

379+
sleepsecs(1);
380+
375381
ASSERT(t1.finished());
376382
ASSERT(t2.finished());
377383
ASSERT(t3.finished());
@@ -404,6 +410,8 @@ namespace ReplSetTests {
404410

405411
c->stopIndexBuilds(dbname, cmd2);
406412

413+
sleepsecs(1);
414+
407415
ASSERT(!t1.finished());
408416
ASSERT(t2.finished());
409417
ASSERT(!t3.finished());
@@ -438,6 +446,8 @@ namespace ReplSetTests {
438446

439447
c->stopIndexBuilds(dbname, cmd3);
440448

449+
sleepsecs(1);
450+
441451
ASSERT(!t1.finished());
442452
ASSERT(!t2.finished());
443453
ASSERT(t3.finished());
@@ -584,6 +594,8 @@ namespace ReplSetTests {
584594

585595
c->stopIndexBuilds(dbname, cmdObj);
586596

597+
sleepsecs(1);
598+
587599
ASSERT(t1.finished());
588600
ASSERT(!t2.finished());
589601

@@ -681,6 +693,8 @@ namespace ReplSetTests {
681693

682694
std::vector<BSONObj> indexes = c->stopIndexBuilds(dbname, cmdObj);
683695

696+
sleepsecs(1);
697+
684698
ASSERT(t1.finished());
685699
ASSERT(t2.finished());
686700
ASSERT(!t3.finished());

src/mongo/dbtests/repltests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
namespace mongo {
3535
void createOplog();
36+
void oldRepl();
3637
}
3738

3839
namespace ReplTests {
@@ -46,6 +47,9 @@ namespace ReplTests {
4647
Client::Context _context;
4748
public:
4849
Base() : _context( ns() ) {
50+
oldRepl();
51+
cmdLine._replSet = "";
52+
cmdLine.oplogSize = 5 * 1024 * 1024;
4953
replSettings.master = true;
5054
createOplog();
5155
ensureHaveIdIndex( ns(), false );

0 commit comments

Comments
 (0)