Skip to content

Commit 31b235a

Browse files
committed
Make a defensive copy of the test definition in command-monitoring/TestRunner.cs because the test case is run twice (async=false/true).
1 parent f5c299d commit 31b235a

File tree

1 file changed

+2
-0
lines changed
  • src/MongoDB.Driver.Tests/Specifications/command-monitoring

1 file changed

+2
-0
lines changed

src/MongoDB.Driver.Tests/Specifications/command-monitoring/TestRunner.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public void TestFixtureSetUp()
9292
[TestCaseSource(typeof(TestCaseFactory), "GetTestCases")]
9393
public void RunTestDefinition(IEnumerable<BsonDocument> data, string databaseName, string collectionName, BsonDocument definition, bool async)
9494
{
95+
definition = (BsonDocument)DeepCopy(definition); // protect against side effects when the same definition is run twice (async=false/true)
96+
9597
BsonValue bsonValue;
9698
if (definition.TryGetValue("ignore_if_server_version_greater_than", out bsonValue))
9799
{

0 commit comments

Comments
 (0)