From dfaa8ca5b078c2bf03c75462846d5155cade4e2c Mon Sep 17 00:00:00 2001 From: Mohammad Dashti Date: Thu, 20 May 2021 06:42:39 +0000 Subject: [PATCH] SERVER-53760 Fixed the `sort_spill_estimate_data_size.js` test to become more determistic --- jstests/noPassthrough/sort_spill_estimate_data_size.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jstests/noPassthrough/sort_spill_estimate_data_size.js b/jstests/noPassthrough/sort_spill_estimate_data_size.js index 0f9d3b4c625..9f7fc62bac6 100644 --- a/jstests/noPassthrough/sort_spill_estimate_data_size.js +++ b/jstests/noPassthrough/sort_spill_estimate_data_size.js @@ -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); })();