summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/aggregation/testshard1.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/jstests/aggregation/testshard1.js b/jstests/aggregation/testshard1.js
index 2f5cbd39d04..1dfc74725ca 100644
--- a/jstests/aggregation/testshard1.js
+++ b/jstests/aggregation/testshard1.js
@@ -17,8 +17,17 @@ function aggregateNoOrder(coll, pipeline) {
}
jsTestLog("Creating sharded cluster");
-var shardedAggTest =
- new ShardingTest({shards: 2, mongos: 1, other: {chunkSize: 1, enableBalancer: true}});
+var shardedAggTest = new ShardingTest({
+ shards: 2,
+ mongos: 1,
+ other: {
+ chunkSize: 1,
+ enableBalancer: true,
+ mongosOptions: {verbose: ''},
+ shardOptions: {verbose: ''},
+ configOptions: {verbose: ''},
+ }
+});
jsTestLog("Setting up sharded cluster");
shardedAggTest.adminCommand({enablesharding: "aggShard"});
@@ -193,6 +202,7 @@ testAvgStdDev();
function testSample() {
jsTestLog('testing $sample');
+ shardedAggTest.printCollectionInfo(db.ts1.getFullName());
[0, 1, 10, nItems, nItems + 1].forEach(function(size) {
var res = db.ts1.aggregate([{$sample: {size: size}}]).toArray();
assert.eq(res.length, Math.min(nItems, size));
@@ -200,6 +210,13 @@ function testSample() {
}
testSample();
+// SERVER-26742 Attempt to reproduce an incorrect number of results being returned.
+testSample();
+testSample();
+testSample();
+testSample();
+testSample();
+
jsTestLog('test $out by copying source collection verbatim to output');
var outCollection = db.ts1_out;
var res = aggregateOrdered(db.ts1, [{$out: outCollection.getName()}]);