Skip to content

Commit 6d55cc3

Browse files
committed
Fix tests that were failing because latest version of the server no longer supports autoIndexId when creating a collection.
1 parent e784d08 commit 6d55cc3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/MongoDB.Driver.Core.Tests/Core/Operations/CreateCollectionOperationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public void Execute_should_create_collection_when_AutoIndexId_is_set(
441441
[Values(false, true)]
442442
bool async)
443443
{
444-
RequireServer.Check();
444+
RequireServer.Check().VersionLessThan("3.7.0");
445445
DropCollection();
446446
var subject = new CreateCollectionOperation(_collectionNamespace, _messageEncoderSettings)
447447
{

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,13 @@ public void TestCreateCollection()
568568
Assert.True(collection.Exists());
569569
}
570570

571-
[Theory]
571+
[SkippableTheory]
572572
[ParameterAttributeData]
573573
public void TestCreateCollectionSetAutoIndexId(
574574
[Values(false, true)]
575575
bool autoIndexId)
576576
{
577+
RequireServer.Check().VersionLessThan("3.7.0");
577578
var collection = _database.GetCollection("cappedcollection");
578579
collection.Drop();
579580
var options = CollectionOptions.SetAutoIndexId(autoIndexId);

0 commit comments

Comments
 (0)