Skip to content

Commit 529d69f

Browse files
committed
Fix test that was failing when using the wired tiger storage engine.
1 parent e4b0f6c commit 529d69f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

MongoDB.DriverUnitTests/MongoCollectionTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,12 @@ public void TestHashedIndex()
20132013
else
20142014
{
20152015
var winningPlan = plan["queryPlanner"]["winningPlan"].AsBsonDocument;
2016-
var inputStage = winningPlan["inputStage"]["inputStage"].AsBsonDocument; // not sure why there are two inputStages
2016+
var inputStage = winningPlan["inputStage"].AsBsonDocument;
2017+
// working around a server bug were sometimes the inputStage is nested inside the inputStage
2018+
if (inputStage.Contains("inputStage"))
2019+
{
2020+
inputStage = inputStage["inputStage"].AsBsonDocument;
2021+
}
20172022
var stage = inputStage["stage"].AsString;
20182023
var keyPattern = inputStage["keyPattern"].AsBsonDocument;
20192024
Assert.That(stage, Is.EqualTo("IXSCAN"));

0 commit comments

Comments
 (0)