summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-12-17 11:25:12 -0500
committerEliot Horowitz <eliot@10gen.com>2014-12-17 11:25:24 -0500
commit0c0fd893733ee8b60aed993e1ddbabac468bc89f (patch)
tree13a97d30f36d95820c672bcd7871fc88dda866ba /src
parentf8331e15dfefff9bd4cfd23f197dcb535d0a2ea3 (diff)
downloadmongo-0c0fd893733ee8b60aed993e1ddbabac468bc89f.tar.gz
SERVER-16235: fix capped tests to work with WT
Diffstat (limited to 'src')
-rw-r--r--src/mongo/dbtests/querytests.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mongo/dbtests/querytests.cpp b/src/mongo/dbtests/querytests.cpp
index f0a9584782c..fb057adc0ef 100644
--- a/src/mongo/dbtests/querytests.cpp
+++ b/src/mongo/dbtests/querytests.cpp
@@ -1216,7 +1216,7 @@ namespace QueryTests {
{
WriteUnitOfWork wunit(&_txn);
ASSERT( userCreateNS(&_txn, ctx.db(), ns(),
- fromjson( "{ capped : true, size : 2000 }" ), false ).isOK() );
+ fromjson( "{ capped : true, size : 2000, max: 10000 }" ), false ).isOK() );
wunit.commit();
}
@@ -1356,9 +1356,19 @@ namespace QueryTests {
ASSERT( _client.runCommand( "unittests", BSON( "create" << "querytests.findingstart" << "capped" << true << "$nExtents" << 5 << "autoIndexId" << false ), info ) );
int i = 0;
- for( int oldCount = -1;
- count() != oldCount;
- oldCount = count(), _client.insert( ns(), BSON( "ts" << i++ ) ) );
+ int max = 1;
+
+ while ( 1 ) {
+ int oldCount = count();
+ _client.insert( ns(), BSON( "ts" << i++ ) );
+ int newCount = count();
+ if ( oldCount == newCount ||
+ newCount < max )
+ break;
+
+ if ( newCount > max )
+ max = newCount;
+ }
for( int k = 0; k < 5; ++k ) {
_client.insert( ns(), BSON( "ts" << i++ ) );