Skip to content

Commit 5beef17

Browse files
committed
Fixed up write concerns in secondaryReadTest
1 parent e257252 commit 5beef17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/com/mongodb/SecondaryReadTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void testSecondaryReadCursor() throws Exception {
8383

8484
final DBCollection col = loadCleanDbCollection(mongo);
8585

86-
insertTestData(col, new WriteConcern(getSecondaryCount(testHosts) + 1));
86+
insertTestData(col, new WriteConcern(getSecondaryCount(testHosts) + 1, 10000));
8787

8888
// Get the opcounter/query data for the hosts.
8989
loadQueryCount(testHosts, true);
@@ -209,7 +209,7 @@ private DB getDatabase(final Mongo pMongo) {
209209
private void insertTestData(final DBCollection pCol, WriteConcern writeConcern) throws Exception {
210210
// Insert some test data.
211211
for (int idx=0; idx < 1000; idx++) {
212-
WriteConcern curWriteConcern = idx == 999 ? WriteConcern.NONE : writeConcern;
212+
WriteConcern curWriteConcern = (idx < 999) ? WriteConcern.NONE : writeConcern;
213213
WriteResult writeResult = pCol.insert(new BasicDBObject(), curWriteConcern);
214214
writeResult.getLastError().throwOnError();
215215
}

0 commit comments

Comments
 (0)