0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

SERVER-53760 Fixed the sort_spill_estimate_data_size.js test to become more determistic

This commit is contained in:
Mohammad Dashti 2021-05-20 06:42:39 +00:00 committed by Evergreen Agent
parent 6a66dcf61e
commit dfaa8ca5b0

View File

@ -50,7 +50,7 @@ function createPipeline(collection) {
return collection.aggregate(
[
{$unwind: "$data"},
{$sort: {'_id': -1, 'data.val': -1}},
{$sort: {'_id': -1, 'data.uniqueValue': -1}},
{$limit: 900},
{$group: {_id: 0, sumTop900UniqueValues: {$sum: '$data.uniqueValue'}}}
],
@ -67,7 +67,7 @@ const dataBytesSorted = sort["totalDataSizeSortedBytesEstimate"];
// The total data size sorted is no greater than 3x the total size of all documents sorted.
assert.lt(dataBytesSorted, 3 * totalSize, explain);
assert.eq(createPipeline(coll).toArray(), [{_id: 0, sumTop900UniqueValues: 84550}], explain);
assert.eq(createPipeline(coll).toArray(), [{_id: 0, sumTop900UniqueValues: 94550}], explain);
MongoRunner.stopMongod(conn);
})();