summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorIan Boros <puppyofkosh@gmail.com>2019-04-29 12:00:52 -0400
committerIan Boros <puppyofkosh@gmail.com>2019-04-29 12:52:54 -0400
commit5c1bcbb89014db9d0db51b891d4836cb80d29ecb (patch)
treebdc1961167e6283edb92c930eb527fdf7d8d4210 /jstests
parente4b08de746ef4e472bfdd4790fdb2b89d5a62f1a (diff)
downloadmongo-5c1bcbb89014db9d0db51b891d4836cb80d29ecb.tar.gz
SERVER-40509 Add debug logging to yield_geonear_dedup
Diffstat (limited to 'jstests')
-rw-r--r--jstests/concurrency/fsm_workloads/yield_geo_near_dedup.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/jstests/concurrency/fsm_workloads/yield_geo_near_dedup.js b/jstests/concurrency/fsm_workloads/yield_geo_near_dedup.js
index ac338902911..7fb5c860a7a 100644
--- a/jstests/concurrency/fsm_workloads/yield_geo_near_dedup.js
+++ b/jstests/concurrency/fsm_workloads/yield_geo_near_dedup.js
@@ -56,17 +56,22 @@ var $config = extendWorkload($config, function($config, $super) {
// aggregation may fail if we don't have exactly one 2d index to use.
assertWhenOwnColl(function verifyResults() {
const seenObjs = [];
+ const seenObjsOriginals = [];
while (cursor.hasNext()) {
const doc = cursor.next();
// The pair (_id, timesInserted) is the smallest set of attributes that uniquely
// identifies a document.
const objToSearch = {_id: doc._id, timesInserted: doc.timesInserted};
- const found = seenObjs.some(obj => bsonWoCompare(obj, objToSearch) === 0);
- assertWhenOwnColl(!found,
- `$geoNear returned document ${tojson(doc)} multiple ` +
- `times: ${tojson(seenObjs)}`);
+ for (let i = 0; i < seenObjs.length; ++i) {
+ assertWhenOwnColl.neq(
+ bsonWoCompare(seenObjs[i], objToSearch),
+ 0,
+ () => `$geoNear returned document ${tojson(doc)} multiple ` +
+ `times: first occurence was ${tojson(seenObjsOriginals[i])}`);
+ }
seenObjs.push(objToSearch);
+ seenObjsOriginals.push(doc);
}
});
};