Skip to content

Commit f589388

Browse files
committed
Use smaller values for MaxSize when testing capped collections so tests run faster.
1 parent ff26be5 commit f589388

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/MongoDB.Driver.Core.Tests/Core/Operations/ListCollectionsOperationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private void CreateCappedCollection()
138138
var createCollectionOperation = new CreateCollectionOperation(collectionNamespace, _messageEncoderSettings)
139139
{
140140
Capped = true,
141-
MaxSize = 100000
141+
MaxSize = 10000
142142
};
143143
ExecuteOperation(createCollectionOperation);
144144

src/MongoDB.Driver.Legacy.Tests/MongoCollectionTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,12 @@ public void TestCreateCollectionSetCappedSetMaxDocuments()
549549
var collection = _database.GetCollection("cappedcollection");
550550
collection.Drop();
551551
Assert.IsFalse(collection.Exists());
552-
var options = CollectionOptions.SetCapped(true).SetMaxSize(10000000).SetMaxDocuments(1000);
552+
var options = CollectionOptions.SetCapped(true).SetMaxSize(10000).SetMaxDocuments(1000);
553553
_database.CreateCollection(collection.Name, options);
554554
Assert.IsTrue(collection.Exists());
555555
var stats = collection.GetStats();
556556
Assert.IsTrue(stats.IsCapped);
557-
Assert.IsTrue(stats.StorageSize >= 10000000);
557+
Assert.IsTrue(stats.StorageSize >= 10000);
558558
Assert.IsTrue(stats.MaxDocuments == 1000);
559559
collection.Drop();
560560
}
@@ -566,12 +566,12 @@ public void TestCreateCollectionSetCappedSetMaxSize()
566566
var collection = _database.GetCollection("cappedcollection");
567567
collection.Drop();
568568
Assert.IsFalse(collection.Exists());
569-
var options = CollectionOptions.SetCapped(true).SetMaxSize(5000000000);
569+
var options = CollectionOptions.SetCapped(true).SetMaxSize(10000);
570570
_database.CreateCollection(collection.Name, options);
571571
Assert.IsTrue(collection.Exists());
572572
var stats = collection.GetStats();
573573
Assert.IsTrue(stats.IsCapped);
574-
Assert.IsTrue(stats.StorageSize >= 5000000000);
574+
Assert.IsTrue(stats.StorageSize >= 10000);
575575
collection.Drop();
576576
}
577577

@@ -2297,7 +2297,7 @@ public void TestIsCappedTrue()
22972297
{
22982298
var collection = _database.GetCollection("cappedcollection");
22992299
collection.Drop();
2300-
var options = CollectionOptions.SetCapped(true).SetMaxSize(100000);
2300+
var options = CollectionOptions.SetCapped(true).SetMaxSize(10000);
23012301
_database.CreateCollection("cappedcollection", options);
23022302

23032303
Assert.AreEqual(true, collection.Exists());

0 commit comments

Comments
 (0)