Permalink
Browse files

Fixed up write concerns in secondaryReadTest

  • Loading branch information...
1 parent e257252 commit 5beef1749f0cb8416659f9b4a938e004d6bedb78 @jyemin jyemin committed Oct 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/test/com/mongodb/SecondaryReadTest.java
View
4 src/test/com/mongodb/SecondaryReadTest.java
@@ -83,7 +83,7 @@ public void testSecondaryReadCursor() throws Exception {
final DBCollection col = loadCleanDbCollection(mongo);
- insertTestData(col, new WriteConcern(getSecondaryCount(testHosts) + 1));
+ insertTestData(col, new WriteConcern(getSecondaryCount(testHosts) + 1, 10000));
// Get the opcounter/query data for the hosts.
loadQueryCount(testHosts, true);
@@ -209,7 +209,7 @@ private DB getDatabase(final Mongo pMongo) {
private void insertTestData(final DBCollection pCol, WriteConcern writeConcern) throws Exception {
// Insert some test data.
for (int idx=0; idx < 1000; idx++) {
- WriteConcern curWriteConcern = idx == 999 ? WriteConcern.NONE : writeConcern;
+ WriteConcern curWriteConcern = (idx < 999) ? WriteConcern.NONE : writeConcern;
WriteResult writeResult = pCol.insert(new BasicDBObject(), curWriteConcern);
writeResult.getLastError().throwOnError();
}

0 comments on commit 5beef17

Please sign in to comment.