summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_count.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/query_stage_count.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index 128426f77ee..6fe3479d4d9 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -325,12 +325,15 @@ public:
class QueryStageCountUpdateDuringYield : public CountStageTest {
public:
void run() {
- // expected count would be kDocuments-2 but we update the first and second records
- // after doing the first unit of work so they wind up getting counted later on
CountCommandRequest request((NamespaceString(ns())));
request.setQuery(BSON("x" << GTE << 2));
- testCount(request, kDocuments);
+ // We call 'interject' after first unit of work that skips the first document, so it is
+ // not counted.
+ testCount(request, kDocuments - 1);
+
+ // We call 'interject' after first unit of work and even if some documents are skipped,
+ // they are added to the end of the index on x so they are counted later.
testCount(request, kDocuments, true);
}